Skip to content

fix: check if path item is method operation #366

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 8 commits into from
Nov 19, 2020
Merged

fix: check if path item is method operation #366

merged 8 commits into from
Nov 19, 2020

Conversation

rendall
Copy link
Contributor

@rendall rendall commented Nov 13, 2020

Fixes issue #360

  • Adds a check isMethod in transformPaths in ./src/v3.ts
  • Adds a new OpenAPI3PathItemObject type in ./src/types/OpenAPI3.ts
  • This added type OpenAPI3PathItemObject is per "PathItemObject" spec https://swagger.io/specification/#path-item-object
  • Replaces the key-value pair in OpenAPI3Paths
  • OpenAPI3PathItemObject is missing the servers field from the specs
  • Variable name bikeshedding - changed method to field since it might not be a method

Edit: updated type to OpenAPI3PathItemObject from OpenAPI3PathItem

New `OpenAPI3PathItem` limits possible methods
Missing `servers` key added as `any` type
paths include 'summary' and 'description'
@codecov
Copy link

codecov bot commented Nov 13, 2020

Codecov Report

Merging #366 (2ad93b1) into main (14c0a96) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #366      +/-   ##
==========================================
+ Coverage   92.91%   92.93%   +0.02%     
==========================================
  Files           5        5              
  Lines         268      269       +1     
  Branches       90       90              
==========================================
+ Hits          249      250       +1     
  Misses         13       13              
  Partials        6        6              
Impacted Files Coverage Δ
src/v3.ts 96.29% <100.00%> (+0.02%) ⬆️

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 4067236...2ad93b1. Read the comment docs.

@rendall rendall changed the title Add path key check Add isMethod check in transformPaths Nov 13, 2020
Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

Great PR overall!

@gr2m gr2m changed the title Add isMethod check in transformPaths fix: check if path item is method operation Nov 15, 2020
Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

looks good to me 👍🏼

ping @drwpow for 2nd review, I'm new here :D

@drwpow drwpow merged commit 2fd6adf into openapi-ts:main Nov 19, 2020
@drwpow
Copy link
Contributor

drwpow commented Nov 19, 2020

@all-contributors please add @rendall for code, bug, test

@allcontributors
Copy link
Contributor

@drwpow

I've put up a pull request to add @rendall! 🎉

@drwpow
Copy link
Contributor

drwpow commented Nov 19, 2020

Released in v2.4.2! 🚀

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