Page 1 of 1

OpenAPI: Validate $ref

Posted: Thu Jun 26, 2025 2:23 pm
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.

Re: OpenAPI: Validate $ref

Posted: Thu Jun 26, 2025 6:03 pm
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

Re: OpenAPI: Validate $ref

Posted: Fri Jun 27, 2025 9:02 am
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.