Skip to content

externalValue doesn't permit for relative references #2819

@spiderPan

Description

@spiderPan

Please delete this section, and any sections below that you don't use, before creating the issue.

Describe the bug

Starting from OAS 3.1.0, the externalValue should allow relative reference, See the documentation

To Reproduce

  1. Create a schema as following using openapi:3.1.0
Response:
      description: OK
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResponseSchema'
          examples:
            jsonObject:
              externalValue: "./components/response.json"
  1. Attempt to use spectral to validate this schema with spectral:oas rule.
  2. Validation failed with
error  oas3-schema            "externalValue" property must match format "uri".

Expected behavior
Spectral validation should pass and allow for relative URLs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions