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

tests should fail for additionalProperties in nested objects #201

Closed
ScatteredInk opened this issue Jun 13, 2019 · 2 comments
Closed

tests should fail for additionalProperties in nested objects #201

ScatteredInk opened this issue Jun 13, 2019 · 2 comments

Comments

@ScatteredInk
Copy link
Collaborator

At the moment, this entityStatement will fail if used in a test:

 {
    "extraField": "hello",
    "publicationDetails": {
      "publicationDate": "2019-06-13",
      "publisher": {
        "name": "Example Register"
      },
      "bodsVersion": "0.2"
    },
    "statementID": "60bb3996-b434-4377-930b-39972c65b400",
    "statementType": "entityStatement",
    "statementDate": "2019-05-05",
    "entityType": "registeredEntity",
    "name": "Listed Company OS-17"
}

But this entityStatement will pass:

 {
    "publicationDetails": {
      "extraField": "hello",
      "publicationDate": "2019-06-13",
      "publisher": {
        "name": "Example Register"
      },
      "bodsVersion": "0.2"
    },
    "statementID": "60bb3996-b434-4377-930b-39972c65b400",
    "statementType": "entityStatement",
    "statementDate": "2019-05-05",
    "entityType": "registeredEntity",
    "name": "Listed Company OS-17"
}

This line is adding additionalProperties false only at the root of the object, whereas we want it everywhere.

schema['additionalProperties'] = False

This file was built before we had compile-to-jsonschema so maybe worth switching to that here?

@kd-ods
Copy link
Collaborator

kd-ods commented Aug 9, 2019

Yes - just saw this: OpenDataServices/compile-to-json-schema#4

@ScatteredInk
Copy link
Collaborator Author

Fixed with #251

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

No branches or pull requests

2 participants