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

Inability to Set Additional Properties to False in TypeSpec #5393

Open
3 tasks done
mario-guerra opened this issue Dec 17, 2024 · 0 comments
Open
3 tasks done

Inability to Set Additional Properties to False in TypeSpec #5393

mario-guerra opened this issue Dec 17, 2024 · 0 comments

Comments

@mario-guerra
Copy link
Member

Clear and concise description of the problem

Issue described by Chris Wood at Ozone API in this talk.

Description:

TypeSpec currently does not support setting the additionalProperties keyword to false. This is a significant issue for financial services APIs, where it is crucial to prevent the inclusion of extra properties that are not explicitly defined in the schema.

In many open banking and open finance standards, it is essential to enforce strict schemas to ensure data integrity and compliance with regulatory requirements. The inability to set additionalProperties to false leads to potential schema violations and requires additional manual steps to correct the emitted Open API document.

Steps to Reproduce:

  1. Define a schema in TypeSpec.
  2. Attempt to set additionalProperties to false.
  3. Emit the Open API document.
  4. Observe that the additionalProperties setting is not applied.

Expected Behavior:
TypeSpec should allow setting additionalProperties to false, ensuring that no extra properties are allowed in the JSON objects defined by the schema.

Actual Behavior:
The emitted Open API document does not include the additionalProperties setting, allowing extra properties to be included in the JSON objects.

Additional Context:
Enhancing TypeSpec to support the additionalProperties keyword would improve the accuracy and compliance of the emitted Open API documents, particularly for financial services APIs that require strict schema enforcement.

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant