Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Add description on enum constants #133

Merged

Conversation

clementdenis
Copy link
Contributor

This PR allows to set a description on enum values in API method parameters, as allowed in the discovery format.

PS: we tried to implement description for enums in Swagger here, as described in Swagger documentation for enums, using the description field, but we preferred not to include it yet.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@kaldebert
Copy link

I'm ok with my commits being contributed to this project.

@tangiel
Copy link
Contributor

tangiel commented Feb 8, 2018

Looks like merging the other PR puts this in conflict. Please fix.

@codecov-io
Copy link

codecov-io commented Feb 9, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@be24045). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #133   +/-   ##
=========================================
  Coverage          ?   79.86%           
  Complexity        ?     1662           
=========================================
  Files             ?      156           
  Lines             ?     5568           
  Branches          ?      716           
=========================================
  Hits              ?     4447           
  Misses            ?      843           
  Partials          ?      278
Impacted Files Coverage Δ Complexity Δ
.../api/server/spi/config/model/SchemaRepository.java 92.15% <100%> (ø) 28 <0> (?)
...e/api/server/spi/discovery/DiscoveryGenerator.java 87.74% <100%> (ø) 52 <0> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be24045...34b9e4b. Read the comment docs.

@kaldebert
Copy link

kaldebert commented Feb 9, 2018

@tangiel The merge includes the fix for the currently failing master.
The last commit covers the missing case for description of $ref fields.

for (Object enumConstant : type.getRawType().getEnumConstants()) {
builder.addEnumValue(enumConstant.toString());
builder.addEnumDescription("");
.setName(Types.getSimpleName(type, config.getSerializationConfig()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for changing this indent?

@@ -0,0 +1,27 @@
/*
* Copyright 2016 Google Inc. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put 2018 here.

@tangiel tangiel merged commit 45772ac into cloudendpoints:master Feb 12, 2018
@clementdenis clementdenis deleted the add_description_on_enum_constant branch July 31, 2018 12:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants