Skip to content

Swagger spec improvements: title and description, parameter combining, error model description#37

Merged
RaHery merged 4 commits intomasterfrom
swagger_improvements
Aug 21, 2019
Merged

Swagger spec improvements: title and description, parameter combining, error model description#37
RaHery merged 4 commits intomasterfrom
swagger_improvements

Conversation

@clementdenis
Copy link

@clementdenis clementdenis commented Aug 5, 2019

Add new options for Swagger spec generation

  • Expose error model in response (as default or by service exception)
  • Configure title and description
  • Combine common parameters (both at path and global level)

These changes are grouped as they touch the same code, and would require multiple conflicting merges if handled separately.

@clementdenis clementdenis force-pushed the swagger_improvements branch from a5b7ed5 to 24e9f42 Compare August 5, 2019 13:54
@clementdenis clementdenis changed the title Swagger improvements Swagger spec improvements: parameter combination, error model description Aug 5, 2019
@codecov-io
Copy link

codecov-io commented Aug 5, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #37   +/-   ##
=========================================
  Coverage          ?   81.74%           
  Complexity        ?     1820           
=========================================
  Files             ?      159           
  Lines             ?     6627           
  Branches          ?      870           
=========================================
  Hits              ?     5417           
  Misses            ?      885           
  Partials          ?      325
Impacted Files Coverage Δ Complexity Δ
...rver/spi/response/ServiceUnavailableException.java 14.28% <ø> (ø) 1 <0> (?)
...gle/api/server/spi/response/NotFoundException.java 14.28% <ø> (ø) 1 <0> (?)
...le/api/server/spi/response/ForbiddenException.java 0% <ø> (ø) 0 <0> (?)
...gle/api/server/spi/response/ConflictException.java 14.28% <ø> (ø) 1 <0> (?)
...api/server/spi/response/UnauthorizedException.java 50.98% <ø> (ø) 7 <0> (?)
...ver/spi/response/InternalServerErrorException.java 42.85% <ø> (ø) 3 <0> (?)
...e/api/server/spi/response/BadRequestException.java 42.85% <ø> (ø) 3 <0> (?)
...le/api/server/spi/tools/GetDiscoveryDocAction.java 31.66% <100%> (ø) 3 <0> (?)
...ogle/api/server/spi/tools/EndpointsToolAction.java 84.76% <33.33%> (ø) 44 <0> (?)
...ogle/api/server/spi/tools/GetOpenApiDocAction.java 46.57% <66.66%> (ø) 6 <3> (?)
... and 2 more

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 dc11531...f1ad73b. Read the comment docs.

@clementdenis clementdenis changed the title Swagger spec improvements: parameter combination, error model description Swagger spec improvements: title and description, parameter combining, error model description Aug 12, 2019
@clementdenis clementdenis marked this pull request as ready for review August 12, 2019 12:48
- Option to add GoogleJsonError as default response body
- Option to add GoogleJsonError for specific error code when a method
throws a well-known subclass of ServiceException
- Option to extract common parameters at path level
- Option to extract named parameters at spec level
- Provide a way to customize title and description in info section
- These new options are unit tested, but not exposed yet
- Update UNSUPPORTED_FEATURES
Copy link

@RaHery RaHery left a comment

Choose a reason for hiding this comment

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

Reviewed 32 of 33 files at r1, 11 of 32 files at r2.
Reviewable status: 19 of 25 files reviewed, all discussions resolved (waiting on @RaHery)

@RaHery RaHery merged commit 3d325ec into master Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants