resolveFully doesn't resolve nested schemas
See original GitHub issueI would like to resolve schemas in the following OAS file.
openapi: 3.0.0
info:
title: std classes
version: 1.0.0
contact:
name: Contact name
email: contact@mail.com
paths: {}
components:
schemas:
MessageCategory:
type: string
description: The category describing the severity of the message.
enum:
- INFO
- ERROR
- WARN
ResponseMessage:
type: object
description: Common response message object.
required:
- category
properties:
category:
$ref: "#/components/schemas/MessageCategory"
But if I invoke OpenAPIV3Parser#readLocation() with ParseOptions.resolveFully set to true, category property inside ResponseMessage is not being resolved to the actual object itself. It is still defined as $ref pointing to MessageCategory.
Example of the parsed result, where you can clearly see that the schema wasn’t resolved.
Is resolving of schemas intentionally not supported if the OAS file contains schemas only? How can I resolve schema without writing some dummy paths that contain those schemas in request or response? For me it seems obvious that MessageCategory will be resolved inside ResponseMessage if resolveFully is set to true.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
resolveFully doesn't resolve nested references or normal ...
Issue ==> I am using the resolveFully parse option as mentioned in the documentation but seems its not working for most of my...
Read more >Nesting Schemas — marshmallow 3.19.0 documentation
Schemas can be nested to represent relationships between objects (e.g. foreign key relationships). For example, a Blog may have an author represented by...
Read more >Nested Schemas template - SAP Help Portal
Use a Nested Schemas template to create a JSON file or an XML file that matches a particular input schema. The Nested Schemas...
Read more >Automatically Evolve Your Nested Column Schema, Stream ...
MERGE INTO and UPDATE operations now resolve nested struct columns ... the order of the nested columns does not matter (exactly in the...
Read more >Resolve | webpack
For example, when calling import 'lodash' in ES2015, the resolve options can change ... If multiple files share the same name but have...
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
Hi, @rivancic So I double checked, and the main cause for this to happen id because there are no
Paths
in the spec, so the resolveFully behaviour is not triggered.Hi, @rivancic, parser supports resolveFully for references that are not local, as explained here: https://github.com/swagger-api/swagger-parser#2-resolvefully. I will check if it makes sense to add a ParseOption like
ResolveFullSchemas
or something, to allow the behaviour you need when set totrue
.