Skip to content

swagger-cli validate ./openapi.yaml fails while adding examples in request body with $ref for content #2983

Closed
@LakshmiLavanyaKasturi

Description

@LakshmiLavanyaKasturi

openapi: 3.0.2

API example:

requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: ./api/rosetta/rosetta-account-balance-request.schema.json
            examples:
              network_identifier:
                value: [mainnet]
              account_identifier: 
                value: [SPZ5DJGRVZHXEEEYYGWEX84KQB8P69GC715ZRNW1]

Output:

Swagger schema validation failed.
  #/paths/~1rosetta~1v1~1account~1balance/post/requestBody/content/application~1json/schema must NOT have additional properties
  #/paths/~1rosetta~1v1~1account~1balance/post/requestBody/content/application~1json/schema must have required property '$ref'
  #/paths/~1rosetta~1v1~1account~1balance/post/requestBody/content/application~1json/schema must match exactly one schema in oneOf
  #/paths/~1rosetta~1v1~1account~1balance/post/requestBody must have required property '$ref'
  #/paths/~1rosetta~1v1~1account~1balance/post/requestBody must match exactly one schema in oneOf

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