Skip to content

Modify how x-nullable is resolved next to $ref #2576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 25, 2025

Conversation

AlitzelMendez
Copy link
Member

issue: #1163

@AlitzelMendez AlitzelMendez linked an issue Apr 23, 2025 that may be closed by this pull request
@azure-sdk
Copy link
Collaborator

azure-sdk commented Apr 23, 2025

All changed packages have been documented.

  • @azure-tools/typespec-autorest
Show changes

@azure-tools/typespec-autorest - breaking ✏️

Modify how x-nullable is resolved when a $ref is present.,> ,> Previously, the $ref was placed inside an allOf. With this change, the $ref is now moved directly next to x-nullable.,> ,> diff lang=json,> "Dog": {,> "type": "object",,> "properties": {,> "type": {,> - "type": "object",,> "x-nullable": true,,> + "$ref": "#/definitions/Pet",> - "allOf": [,> - {,> - "$ref": "#/definitions/Pet",> - },> - ],> },> },,> "required": [,> "type",> ],> },>

@azure-sdk
Copy link
Collaborator

azure-sdk commented Apr 23, 2025

You can try these changes here

🛝 Playground 🌐 Website

@AlitzelMendez AlitzelMendez changed the title Modify how x-nullable is resolved when a $ref is present for model type Modify how x-nullable is resolved next to $ref Apr 23, 2025
@AlitzelMendez AlitzelMendez marked this pull request as ready for review April 23, 2025 20:15
Copy link
Member

@markcowl markcowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - another suggested test.

@AlitzelMendez AlitzelMendez added this pull request to the merge queue Apr 25, 2025
Merged via the queue into Azure:main with commit 2f5dbb5 Apr 25, 2025
22 checks passed
@AlitzelMendez AlitzelMendez deleted the modify-ref-nullable-openapi branch April 25, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A model unioned with null introduces inheritance
4 participants