Skip to content
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

airframe-rpc: Generate Open API schema from RPC interfaces #1178

Merged
merged 31 commits into from
Jul 22, 2020

Conversation

xerial
Copy link
Member

@xerial xerial commented Jul 4, 2020

  • Define OpenAPI model classes
    • Support UnionType codec for using A or B in OpenAPI model classes.
  • Create OpenAPI model class from RPC interfaces
  • Create OpenAPI model class from Endpoint interfaces
  • Convert JSON to Yaml
  • Add sbt-airframe plugin command (airframeHttpOpenAPIXXX)
  • Usage note

image

@codecov
Copy link

codecov bot commented Jul 4, 2020

Codecov Report

Merging #1178 into master will increase coverage by 0.31%.
The diff coverage is 87.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1178      +/-   ##
==========================================
+ Coverage   82.60%   82.92%   +0.31%     
==========================================
  Files         279      283       +4     
  Lines       10707    10941     +234     
  Branches      698      727      +29     
==========================================
+ Hits         8845     9073     +228     
- Misses       1862     1868       +6     
Impacted Files Coverage Δ
...la/wvlet/airframe/http/codegen/RouteAnalyzer.scala 95.45% <ø> (ø)
...vlet/airframe/http/codegen/HttpCodeGenerator.scala 19.14% <21.05%> (ø)
...airframe/http/finagle/FinagleResponseHandler.scala 85.71% <57.14%> (-2.82%) ⬇️
...main/scala/wvlet/airframe/json/JSONTraverser.scala 58.33% <57.14%> (+58.33%) ⬆️
...c/main/scala/wvlet/airframe/codec/UnionCodec.scala 66.66% <66.66%> (ø)
...in/scala/wvlet/airframe/http/openapi/OpenAPI.scala 86.66% <86.66%> (ø)
...wvlet/airframe/http/openapi/OpenAPIGenerator.scala 95.38% <95.38%> (ø)
...cala/wvlet/airframe/codec/MessageCodecFinder.scala 87.80% <100.00%> (+0.62%) ⬆️
...vm/src/main/scala/wvlet/airframe/http/Router.scala 90.76% <100.00%> (+2.70%) ⬆️
...ame/http/router/HttpEndpointExecutionContext.scala 95.23% <100.00%> (ø)
... and 14 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 3f3ff3d...a9514b1. Read the comment docs.

@xerial xerial requested a review from a team July 17, 2020 23:48
@xerial
Copy link
Member Author

xerial commented Jul 17, 2020

@shimamoto @takezoe This becomes a big PR, but the basic implementation for generating Open API schema from airframe-http/rpc endpoints is done. Please have a look.

@xerial
Copy link
Member Author

xerial commented Jul 22, 2020

@wvlet/airframe-dev I think reviewing this PR is hard, so let me merge this PR first as a beta-feature because this PR should have no production behavior change.

@xerial xerial merged commit 8a55a5f into wvlet:master Jul 22, 2020
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.

1 participant