Skip to content
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

Implement detection rules for adding / removing x-nullable attribute #22

Open
macisamuele opened this issue Feb 13, 2020 · 0 comments · May be fixed by #28
Open

Implement detection rules for adding / removing x-nullable attribute #22

macisamuele opened this issue Feb 13, 2020 · 0 comments · May be fixed by #28
Assignees
Labels
enhancement New feature or request

Comments

@macisamuele
Copy link
Collaborator

Changing the nullability of an object or property might lead to backward incompatible specs.

For easier understanding we can use the following example

definitions:
  model:
    type: object
    x-model: Model
    properties:
      prop:
        type: string

with the above example we should consider {"prop": "a"} or {} as valid Model and {"prop": null} as invalid.
But adding x-model: true into prop property it makes {"prop": null} a valid Model.

This change is:

  • backward compatible if the object is used in requests parameters, as old clients would continue to send Model instances
  • backward incompatible if the object is used in responses, as old clients might start receiving null values which were not supposed to receive

The objective of this issue is to track the implementation of two complementary rules

  • add x-nullable into response models
  • removing x-nullable from request models

Internal reference: CORESERV-9265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant