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

How to change the required: field on a JsonSchema object? #879

Closed
takanuva15 opened this issue Oct 18, 2023 · 1 comment
Closed

How to change the required: field on a JsonSchema object? #879

takanuva15 opened this issue Oct 18, 2023 · 1 comment

Comments

@takanuva15
Copy link

takanuva15 commented Oct 18, 2023

Hi, I have a base json-schema file that I'm using to validate the response of a few APIs. The APIs all return the same format, but a few APIs return some extra fields that I would like to mark as "required" within the schema for validation. I don't want to duplicate the same json-schema twice just to mark a few fields as required for this small subset of APIs, so I would rather just load my base schema as-is, then add a line in my Java test code to add a few keys into the schema's required: field just for validating the small subset of APIs.

I know the JsonSchema object is thread-safe, so I assume it's been designed to be immutable. Is there an easy way to modify the required: field on a JsonSchema after it's been loaded? (Or otherwise create a clone within Java which would have a different required: list?)

@stevehu
Copy link
Contributor

stevehu commented May 30, 2024

Close as there is no activity.

@stevehu stevehu closed this as completed May 30, 2024
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