Skip to content

Add additionalProperties decorator #4321

Open
@Devon-White

Description

@Devon-White

Clear and concise description of the problem

Related to discussion: #4316

It would be helpful to have a decorator that would allow me to specify models/Unions to not accept additionalProperties.

If the property is not set, JSON schema will default to allowing additionalProperties, which could impact proper validation.

As discussed in the linked discussion, this is visibly an issue when using tools like Monaco editor.

I would expect it to look similar to such:

@additionalProperties(false)
union Test {
  A,
  B,
  C
}

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions