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

language: support for equivalent of JSON Schema's additionalProperites #3312

Open
myitcv opened this issue Jul 22, 2024 · 0 comments
Open

language: support for equivalent of JSON Schema's additionalProperites #3312

myitcv opened this issue Jul 22, 2024 · 0 comments
Labels
FeatureRequest New feature or request roadmap/language-changes Specific tag for roadmap issue #339

Comments

@myitcv
Copy link
Member

myitcv commented Jul 22, 2024

Is your feature request related to a problem? Please describe.

JSON Schema supports the notion of additionalProperties (JSON Schema spec):

The additionalProperties keyword is used to control the handling of extra stuff, that is, properties whose names are not listed in the properties keyword or match any of the regular expressions in the patternProperties keyword. By default any additional properties are allowed.

The value of the additionalProperties keyword is a schema that will be used to validate any properties in the instance that are not matched by properties or patternProperties. Setting the additionalProperties schema to false means no additional properties will be allowed.

CUE currently supports the equivalent of patternProperties via pattern constraints.

But as has been previously noted, pattern constraints do not allow us to encode the semantics of additionalProperties.

Describe the solution you'd like

Support for JSON Schema's additionalProperties. As has been previously suggested, this could look like:

[...Pattern]: expression

Describe alternatives you've considered

No means of doing this.

Additional context

n/a

@myitcv myitcv added FeatureRequest New feature or request roadmap/language-changes Specific tag for roadmap issue #339 labels Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest New feature or request roadmap/language-changes Specific tag for roadmap issue #339
Projects
None yet
Development

No branches or pull requests

1 participant