4.3.x Custom resolvers are incompatible with `options.apiSpec` set to path.
See original GitHub issueRelated to #416
Describe the bug
After upgrading to 4.3.x custom resolvers are incompatible with options.apiSpec
set to path.
In 4.2.3 custom resolver was working with:
resolver: (basePath: string, route) => {
const functionName = route.schema['operationId'];
...
In 4.3.x custom resolver had to be change to different approach because there is no longer .schema
property in the route
:
resolver: (basePath: string, route, apiDoc) => {
const pathKey = route.openApiRoute.substring(route.basePath.length);
const schema = apiDoc.paths[pathKey][route.method.toLowerCase()];
const functionName = schema['operationId'];
...
But it relies on installOperationHandlers
to send apiDoc
always as an object, whereas per line https://github.com/cdimascio/express-openapi-validator/blob/ed7af2b02fa45c069c5bdedf5ccf1eff914e3610/src/openapi.validator.ts#L321 it sends whatever was defined in options (in my case, path to API description doc).
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
apispec - Read the Docs
Custom Fields apispec maps standard marshmallow fields to OpenAPI types and formats. If your custom field subclasses a standard.
Read more >Manage a LoadBalancer resource in Oracle Cloud Infrastructure
Key Key Returned
load_balancer. complex load_balancer. complex on success
backend_sets. complex backend_sets. complex on success
backends. complex on success
Read more >Custom Value Resolvers - AutoMapper documentation
MapFrom(aValueResolverInstance). In the below example, we'll use the first option, telling AutoMapper the custom resolver type through generics:.
Read more >Chapter 13. Deploying installer-provisioned clusters on bare ...
Mirroring an image set in a partially disconnected environment ... Installing a cluster quickly on Alibaba Cloud" Collapse section "4.3.
Read more >gatsby | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
yup, will do
I found that
apiDoc
argument was introduced in #366 in version 3.17.x , so I think the are two problems here:route.schema
is now undefinedapiDoc
is better to be loaded into object before passing into resolver (for uniformity)