-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: upgrade to openapi3-ts@0.11.0 #1265
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
Conversation
| */ | ||
| export interface ParameterObject extends ISpecificationExtension { | ||
| name: string; | ||
| in: ParameterLocation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raymondfeng The openapi3-ts package doesn't have ParameterLocation and ParameterStyle, so its ParameterObject doesn't verify the value of property in and style are valid
jannyHou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to know the new version patches SchemaObject to extend JSON types! 👍
I left a comment regarding ParameterLocation and ParameterStyle.
Adopting the community ParameterObject will lose the editor checking for the valid value of in and style, while validator can still catch invalid value at compile time. So I am fine with either:
- adopt community
ParameterObject: thenParameterLocationandParameterStyleinterface can be removed too. - keep the
ParameterObject: if it causes incompatibility then no need to spend time on it.
@raymondfeng you can do whichever makes more sense.
Otherwise LGTM 🚢
To me, it's important to allow the compiler to catch as many problems as possible - that's one of the reasons we switched from JS to TS. Can we please preserve this feature for ParameterObject's Ideally, we should contribute a fix to For the short-term, I'd prefer to keep our own copy of type declarations needed to fix Thoughts? |
| // tslint:disable-next-line:no-any | ||
| export type ExtensionValue = any; | ||
|
|
||
| export type SchemasObject = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be called SchemaObject (singular Schema)? The old code has export interface SchemaObject.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two types: SchemaObject (for schema definitions) and SchemasObject (for schemas of the spec).
| * e.g. a string, an object or an array. | ||
| */ | ||
| // tslint:disable-next-line:no-any | ||
| export type ExtensionValue = any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, ExtensionValue type is no longer used, could you please remove it too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still referenced in our code base to avoid any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1271
virkt25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @raymondfeng !! Can we have a follow up task to contribute the remaining types to openapi3-ts so we don't have to maintain our own types package anymore.
b-admike
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but consider @bajtos's comment about preserving ParameterObject interface until your patch is landed in openapi3-ts.
The release of openapi3-ts@0.11.0 closes the gap of OAS 3.0 spec. This PR removes most of our own type declarations for the spec.
e7a1e64 to
1047700
Compare
|
Please |
jannyHou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
|
👏 |
The release of openapi3-ts@0.11.0 closes the gap of OAS 3.0 spec.
This PR removes most of our own type declarations for the spec.
Checklist
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated