OpenAPI: Validate $ref

Having trouble installing Oxygen? Got a bug to report? Post it all here.
cweiske
Posts: 4
Joined: Thu Jun 26, 2025 2:19 pm

OpenAPI: Validate $ref

Post by cweiske »

I'm trying to write an OpenAPI yaml document and do not get warned about invalid (non-existing) $ref values.

Example:

Code: Select all

---
openapi: 3.1.0
info:
  version: 1.0.0
  title: Example.com
servers:
- url: http://example.com/api/v1

paths:
  /user:
    get:
      summary: Get user by user name
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoUser'

components:
  schemas:
    User:
      type: object
      properties:
        username:
          description: User supplied username
          type: string
Here the

Code: Select all

$ref: '#/components/schemas/NoUser'
does not exist.

Should Oxygen XML editor validate those?

I'm using the latest version 27.1, build 2025041508.
florin_nica
Posts: 40
Joined: Wed Sep 09, 2020 3:17 pm

Re: OpenAPI: Validate $ref

Post by florin_nica »

Hello,

Thank you for the feedback and for the example.

At the moment, the editor is unable to validate references within OpenAPI documents, as the parsers we use for both YAML and JSON formats are limited to detecting syntax/structure errors only. As a result, missing or invalid $ref values will not be reported. However, one advantage of the JSON editor for OpenAPI documents is that references are clickable—if the referenced component exists, you can navigate to it using Ctrl + click.

Improving the OpenAPI editing experience is part of our future plans, but at this time it is difficult to provide a timeline for when such enhancements will be available.

Regards,
Florin
cweiske
Posts: 4
Joined: Thu Jun 26, 2025 2:19 pm

Re: OpenAPI: Validate $ref

Post by cweiske »

However, one advantage of the JSON editor for OpenAPI documents is that references are clickable—if the referenced component exists, you can navigate to it using Ctrl + click.
Unfortunately this doesn't work for the YAML editor.
Post Reply