Skip to content

Improve generated Swagger spec compatibility with Endpoints Portal #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 1, 2019

Conversation

clementdenis
Copy link

  • Support Endpoints Portal authorization flow
  • Add authorizationUrl and useScopesInAuthFlow issuer config params
  • Define default authorizationUrl for Google id token issuers
  • Add scopes in operation's security (required for Try it! in Portal)
  • Add authorizationUrl in OAuth2 flow (required for Try it! in Portal)
  • Reorder Google id token issuers to have https:// one first
  • New supported Swagger features
  • Support deprecation on Swagger operations with @deprecated
  • Add tags to Swagger operations to group like API Explorer in Portal
  • Inline Map types (including JsonMap) to avoid useless definitions
  • Set default values for parameters
  • Add proper collection format (multi instead of csv)
  • List unsupported features of the spec in UNSUPPORTED_FEATURES.md
  • Order consistency
  • Remove ordering attempt in reflection-based introspection
  • Add ordering in Swagger generation (sort paths by string order)
  • Testing
  • Improve coverage of SwaggerGenerator (array tests)
  • Extract Swagger assertion logic in a truth.dev subject
  • Update truth.dev to 1.0
  • Cleanup
  • Remove writeInternal boolean in SwaggerGenerator (not used)

* Support Endpoints Portal authorization flow
- Add authorizationUrl and useScopesInAuthFlow issuer config params
- Define default authorizationUrl for Google id token issuers
- Add scopes in operation's security (required for Try it! in Portal)
- Add authorizationUrl in OAuth2 flow (required for Try it! in Portal)
- Reorder Google id token issuers to have https:// one first
* New supported Swagger features
- Support deprecation on Swagger operations with @deprecated
- Add tags to Swagger operations to group like API Explorer in Portal
- Inline Map types (including JsonMap) to avoid useless definitions
- Set default values for parameters
- Add proper collection format (multi instead of csv)
- List unsupported features of the spec in UNSUPPORTED_FEATURES.md
* Order consistency
- Remove ordering attempt in reflection-based introspection
- Add ordering in Swagger generation (sort paths by string order)
* Testing
- Improve coverage of SwaggerGenerator (array tests)
- Extract Swagger assertion logic in a truth.dev subject
- Update truth.dev to 1.0
* Cleanup
- Remove writeInternal boolean in SwaggerGenerator (not used)
@codecov-io
Copy link

Codecov Report

Merging #34 into master will increase coverage by 0.46%.
The diff coverage is 89.44%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #34      +/-   ##
===========================================
+ Coverage     81.14%   81.6%   +0.46%     
- Complexity     1738    1775      +37     
===========================================
  Files           159     159              
  Lines          6432    6495      +63     
  Branches        842     856      +14     
===========================================
+ Hits           5219    5300      +81     
+ Misses          900     875      -25     
- Partials        313     320       +7
Impacted Files Coverage Δ Complexity Δ
.../main/java/com/google/api/server/spi/Constant.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...ogle/api/server/spi/tools/GetOpenApiDocAction.java 38.46% <0%> (ø) 3 <0> (ø) ⬇️
.../google/api/server/spi/config/model/ApiConfig.java 95.09% <0%> (ø) 69 <0> (ø) ⬇️
...le/api/server/spi/config/model/ApiClassConfig.java 64.81% <0%> (ø) 30 <0> (ø) ⬇️
...e/api/server/spi/config/model/ApiMethodConfig.java 83.75% <100%> (+0.33%) 72 <2> (+2) ⬆️
...server/spi/config/annotationreader/IssuerUtil.java 88.88% <100%> (+0.65%) 8 <0> (ø) ⬇️
.../api/server/spi/config/model/SchemaRepository.java 93.67% <100%> (+0.04%) 39 <2> (+2) ⬆️
...rver/spi/config/model/ApiIssuerAudienceConfig.java 91.66% <50%> (-3.99%) 14 <2> (+1)
.../api/server/spi/config/model/ApiIssuerConfigs.java 78% <60%> (+0.22%) 12 <1> (ø) ⬇️
...m/google/api/server/spi/MethodHierarchyReader.java 68.25% <75%> (-0.5%) 19 <1> (-1)
... and 6 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 613d135...5da75d8. Read the comment docs.

Copy link

@alarribeau alarribeau left a comment

Choose a reason for hiding this comment

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

It looks ok but to be honest I can't assure it. Let's merge and see :)
(It could have been splited in various PRs and/or commits. For remaining swagger features, if we do support them, I suggest to create 1 PR by feature).

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.

+1

Reviewed 1 of 40 files at r1.
Reviewable status: 1 of 40 files reviewed, all discussions resolved (waiting on @llbrt and @RaHery)

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.

:lgtm:

Reviewable status: 1 of 40 files reviewed, all discussions resolved (waiting on @llbrt and @RaHery)

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 39 of 40 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @llbrt)

Copy link

@llbrt llbrt left a comment

Choose a reason for hiding this comment

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

idem, :lgtm:

Reviewed 40 of 40 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link

@llbrt llbrt left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

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.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@alarribeau alarribeau merged commit 4ea599e into master Aug 1, 2019
@clementdenis clementdenis deleted the openapi_generation_for_portal branch February 21, 2022 13:10
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.

5 participants