When referencing another schema, and making it nullable it breaks the export

Output while using “Reference other schemas”

    "description": "",
    "anyOf": [
        {
            "description": "",
            "$ref": "#/definitions/407005"
        },
        {
            "type": "null"
        }
    ]
}```

Instead of adding a nullable attribute with the ref to the property.

This creates issue's with code-generators for the open-api-spec.

Thank you for the feedback. We’ll look into this issue.

Hi, did you export spec in OpenAPI 3.0 format?

Evans Yes, I did

Evans I have also researched this a bit more and I have to admit I was a bit in the wrong as well:

        foo:
          description: Foo description
          anyOf:
            - description: Foo description
              $ref: '#/definitions/407005'
            - type: 'null'
          $ref: '#/components/schemas/Foo'

While the correct syntax that works without any issue’s should be:

        unitProfile:
          description: Foo description
          anyOf:
            - $ref: '#/components/schemas/Foo'
            - type: 'null'

It seems like it doesn’t link the correct definition anymore, combined with the description in the anyOf definition of the ref creates an invalid yaml, the description in the anyOf isn’t a real problem (more that the spec disallows it, but generating still works).
But the wrong definition reference gives issue’s ofcourse.

Johannes Thanks for your feedback, we’ll look into it.

Hi is there any news about this bug? It is quite annoying and breaks the validation we do of our backend through the open api spec file.

Hello, we have already fixed this issue and are currently testing it. The fixed version is expected to be released this week.

Excellent news!

Thanks

Hello, this issue has been fixed and released. You can update to version 2.7.22 to use it.