mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
feat: extend refs in openapi (#3170)
This commit is contained in:
parent
e6c5b22d4b
commit
341e8ead12
@ -83,7 +83,7 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@unleash/express-openapi": "^0.2.1",
|
||||
"@unleash/express-openapi": "^0.2.2",
|
||||
"ajv": "^8.11.0",
|
||||
"ajv-formats": "^2.1.1",
|
||||
"async": "^3.2.4",
|
||||
|
@ -11,7 +11,6 @@ const ajv = new Ajv({
|
||||
schemas: Object.values(schemas).map((schema) =>
|
||||
omitKeys(schema, 'components'),
|
||||
),
|
||||
|
||||
// example was superseded by examples in openapi 3.1, but we're still on 3.0, so
|
||||
// let's add it back in!
|
||||
keywords: ['example'],
|
||||
|
@ -29,7 +29,7 @@ export class OpenApiService {
|
||||
this.api = openapi(
|
||||
this.docsPath(),
|
||||
createOpenApiSchema(config.server),
|
||||
{ coerce: true },
|
||||
{ coerce: true, extendRefs: true },
|
||||
);
|
||||
}
|
||||
|
||||
|
2
src/lib/types/openapi.d.ts
vendored
2
src/lib/types/openapi.d.ts
vendored
@ -12,6 +12,6 @@ declare module '@unleash/express-openapi' {
|
||||
export default function openapi(
|
||||
docsPath: string,
|
||||
document: Omit<OpenAPIV3.Document, 'paths'>,
|
||||
options?: { coerce: boolean },
|
||||
options?: { coerce: boolean; extendRefs: boolean },
|
||||
): IExpressOpenApi;
|
||||
}
|
||||
|
@ -1353,10 +1353,10 @@
|
||||
"@typescript-eslint/types" "5.52.0"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
"@unleash/express-openapi@^0.2.1":
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@unleash/express-openapi/-/express-openapi-0.2.1.tgz#ecbba742dad0a05c1563f35e3272ee3671dc478d"
|
||||
integrity sha512-wvwgSrzMGo3khB2E/xPLXlB/uT6FruszIsUDThJpttILtxBmj1SDWb0L6SG1CQ2tlnC786/6+0iSBwcz0fViOg==
|
||||
"@unleash/express-openapi@^0.2.2":
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/@unleash/express-openapi/-/express-openapi-0.2.2.tgz#b6e6a3d0fb93f8f52fc7d8f375e9bb52a3d3a46e"
|
||||
integrity sha512-Evn1gVB5v7QMAs/mGjTc3NihX9wZnMdyBPvpd/JqMI8NDH9z/q46cYnh2t7bFPQj7FBghWwZlcJNm7PU0bxe7A==
|
||||
dependencies:
|
||||
ajv "^6.10.2"
|
||||
http-errors "^1.7.3"
|
||||
|
Loading…
Reference in New Issue
Block a user