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

Split out and organise openapi code #160

Merged
merged 6 commits into from
Mar 1, 2022
Merged

Split out and organise openapi code #160

merged 6 commits into from
Mar 1, 2022

Conversation

arlyon
Copy link
Owner

@arlyon arlyon commented Jan 31, 2022

This is a first attempt into breaking up the openapi code and making it more approachable. The main focus is on top-level visibility, simplifying the APIs used in main.

Usage is as follows:

  • load the spec
  • create a Metadata
  • create a UrlFinder
  • call Metadata::get_files to get FileGenerators for each object in the API
  • call FileGenerator::write for each file
  • call FileGenerator::write for the generators produced by the first write

I also took the opportunity to:

  • replace prints with proper logging
  • fix a number of clippy lints
  • selectively enable / disable Boxing based on a (currently primitive) heuristic

This will hopefully provide a base to better define the abstractions now that the code is a little tidier.

@codecov
Copy link

codecov bot commented Jan 31, 2022

Codecov Report

Merging #160 (570a30a) into master (af95ea4) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #160      +/-   ##
=========================================
- Coverage    4.43%   4.41%   -0.02%     
=========================================
  Files         119     120       +1     
  Lines       10102   10187      +85     
=========================================
+ Hits          448     450       +2     
- Misses       9654    9737      +83     
Impacted Files Coverage Δ
openapi/src/file_generator.rs 0.00% <0.00%> (ø)
openapi/src/metadata.rs 0.00% <0.00%> (ø)
src/resources/generated/account.rs 1.86% <ø> (ø)
src/resources/generated/alipay_account.rs 0.00% <ø> (ø)
src/resources/generated/api_errors.rs 0.00% <ø> (ø)
src/resources/generated/application.rs 0.00% <ø> (ø)
src/resources/generated/application_fee.rs 0.00% <ø> (ø)
src/resources/generated/balance.rs 0.00% <ø> (ø)
src/resources/generated/balance_transaction.rs 0.00% <ø> (ø)
src/resources/generated/bank_account.rs 0.00% <ø> (ø)
... and 65 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 af95ea4...570a30a. Read the comment docs.

@arlyon arlyon marked this pull request as draft January 31, 2022 06:15
@arlyon arlyon marked this pull request as ready for review February 10, 2022 15:50
@arlyon
Copy link
Owner Author

arlyon commented Feb 10, 2022

CI is currently broken due to an MSRV bump issue. More context: tokio-rs/tracing#1913

@arlyon arlyon merged commit 0a65a3c into master Mar 1, 2022
@arlyon arlyon deleted the feat/openapi-cleanup branch April 2, 2022 10:35
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