Skip to content

Add paths support #328

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
Oct 8, 2020
Merged

Add paths support #328

merged 1 commit into from
Oct 8, 2020

Conversation

drwpow
Copy link
Contributor

@drwpow drwpow commented Oct 8, 2020

Satisfies #236. Though this doesn’t have 100% of all paths features, it’s at least a start 🙂

cc @gr2m (wanted to tag you to let you know this is done, and will be ready for testing in the next release!)

> = {};
responses.parameters.forEach((p) => {
if (!allParameters[p.in]) allParameters[p.in] = {};
// TODO: handle $ref parameters
Copy link
Contributor Author

Choose a reason for hiding this comment

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

parameters can be a $ref rather than an object. The first cut doesn’t handle that (yet)


finalOutput += "export interface components {\n";

// TODO: handle components.parameters
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We also don’t yet handle components.parameters, which would be needed for $ref parameters (above)

@codecov
Copy link

codecov bot commented Oct 8, 2020

Codecov Report

Merging #328 into master will increase coverage by 2.53%.
The diff coverage is 88.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #328      +/-   ##
==========================================
+ Coverage   86.40%   88.93%   +2.53%     
==========================================
  Files           5        5              
  Lines         250      226      -24     
  Branches       88       77      -11     
==========================================
- Hits          216      201      -15     
+ Misses         22       18       -4     
+ Partials       12        7       -5     
Impacted Files Coverage Δ
src/index.ts 81.81% <60.00%> (-4.55%) ⬇️
src/v2.ts 83.72% <81.57%> (-2.95%) ⬇️
src/v3.ts 90.72% <90.32%> (+22.42%) ⬆️
src/utils.ts 95.55% <93.75%> (-1.89%) ⬇️
src/property-mapper.ts 84.21% <100.00%> (+5.26%) ⬆️

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 b77e3b7...ceab3b5. Read the comment docs.

@drwpow drwpow closed this Oct 8, 2020
@drwpow drwpow reopened this Oct 8, 2020
@drwpow drwpow merged commit b3526df into master Oct 8, 2020
@drwpow drwpow deleted the drwpow/paths branch October 8, 2020 05:11
gr2m added a commit to octokit/openapi-types.ts that referenced this pull request Oct 14, 2020
using currently unreleased version of `swagger-to-ts`, see openapi-ts/openapi-typescript#328
@gr2m
Copy link
Contributor

gr2m commented Oct 14, 2020

fyi I'm currently exploring generating types from GitHub's OpenAPI spec and will send pull requests to address the bugs I've found. See octokit/openapi-types.ts#1

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.

2 participants