Skip to content

test(repository-json-schema): verify "not.anyOf" in model schema#3906

Merged
bajtos merged 1 commit into
masterfrom
test/model-schema-exclude-props
Oct 10, 2019
Merged

test(repository-json-schema): verify "not.anyOf" in model schema#3906
bajtos merged 1 commit into
masterfrom
test/model-schema-exclude-props

Conversation

@bajtos

@bajtos bajtos commented Oct 10, 2019

Copy link
Copy Markdown
Member

Modify the tests for JsonSchemaOption "exclude" to verify that"not" + "anyOf" is used to forbid excluded properties in data.

See the following discussion for background context: #3895 (comment)

The PR that introduced the tests I am modifying: #3297

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

Modify the tests for JsonSchemaOption "exclude" to verify that
"not" + "anyOf" is used to forbid excluded properties in data.

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
@bajtos bajtos added the OpenAPI label Oct 10, 2019
@bajtos bajtos added this to the Oct 2019 milestone milestone Oct 10, 2019
@bajtos bajtos self-assigned this Oct 10, 2019

@jannyHou jannyHou left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM :shipit:
Commented a question.

description: {type: 'string'},
},
not: {
anyOf: [{required: ['id']}],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

a question: why the generated excluding schema doesn't have properties field like:

not: {
  anyOf: [{properties: {id: {type: 'string'}}, required: ['id']}]
}

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

a question: why the generated excluding schema doesn't have properties field like:

not: {
  anyOf: [{properties: {id: {type: 'string'}}, required: ['id']}]
}

IDK 🤷‍♂

@nabdelgadir, you are the author of this schema, do you perhaps know the answer?

@bajtos bajtos merged commit 76a3db6 into master Oct 10, 2019
@bajtos bajtos deleted the test/model-schema-exclude-props branch October 10, 2019 14:59
@bajtos bajtos added the Schema label Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants