-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Drop our openapi-spec packages, use openapi3-ts instead #301
Comments
Related: #182. |
@jannyHou , with your openapiv3 work, is this ticket still valid? |
From what I remember, our OpenAPI v3 packages are using a 3rd party dependency under the hood, but adding some extra features/types on top of that dependency. I would personally like more if we could contribute our improvements to that 3rd party package and start using it directly. IIRC, @jannyHou had good arguments against that, could you @jannyHou please re-post them here please? |
@jannyHou any updates for this? |
@bajtos @virkt25 Nice to know we already have an issue to continue the discussion. Copy paste from my V3 prototype PR: From @bajtos From @jannyHou Interesting..by relying on the community module, I have two concerns:
export type ParameterLocation = 'query' | 'header' | 'path' | 'cookie';
export interface ParameterObject extends ISpecificationExtension {
name: string;
// `openapi3-ts` define it as string by `in: string`
in: ParameterLocation;
// ...other properties
} Essentially So as a compromised solution, what I did is:
And I got some feedback from @raymondfeng If the module is in a good shape and the maintainer is collaborative, +1 to use it. We can folk it any time if things won't work out any more. |
export type ParameterLocation = 'query' | 'header' | 'path' | 'cookie';
export interface ParameterObject extends ISpecificationExtension {
name: string;
// `openapi3-ts` define it as string by `in: string`
in: ParameterLocation;
// ...other properties
}
My opinion: if the OpenAPI spec mandates a well-defined list of valid |
BTW, looks like we have already dropped most of our custom type definitions. As of today (0411811aa), openapi-v3-spec-types provides only few helpers:
I am proposing to:
|
The proposal sounds great to me 👍 better to organize the spec-gen codes into one package |
@jannyHou , looks like we're done with this task? Is it good to close? Thanks. |
It's not ... this package still exists https://github.com/strongloop/loopback-next/tree/master/packages/openapi-v3-types and |
Let me copy the items from #301 (comment) into acceptance criteria of this story. |
@dhmlau +1 for Taranveer's comment it's not done yet. And +1 for Miroslav's acceptance criteria 👍 |
https://github.com/metadevpro/openapi3-ts looks more feature complete than our own openapi packages. Should we use openapi3-ts instead?
If we want to support both Swagger v2 and OpenAPI v3 then we probably cannot drop our packages, unless there is a replacement available.
UPDATE:
Looks like we have already dropped most of our custom type definitions. As of today (0411811aa), openapi-v3-spec-types provides only few helpers:
OpenApiSpec
as an alias forOpenAPIObject
createEmptyApiSpec()
isSchemaObject()
andisReferenceObject()
(type guards)Acceptance criteria
openapi3-ts
- see Add type guards for SchemaObject and ReferenceObject metadevpro/openapi3-ts#46 and Refactor openapi guards to use the upstream version #2974try to upstreamcreateEmptyApiSpec
, e.g. to src/dsl/OpenApiBuilder.tsopenapi-v3
package(- see Remove usages of "@loopback/openapi-v3-types" and deprecate the package #3220createEmptyApiSpec
should go toopenapi--spec-builder
package)openapi-v3-types
- see feat: remove openapi-v3-types package #3385The text was updated successfully, but these errors were encountered: