Skip to content

resolveFully doesn't resolve nested schemas #1538

@rivancic

Description

@rivancic

I 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: [email protected]
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.

oas-resolve-fully-not-working

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions