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

Schema Mapping Validation Between JSON Schemas #2338

Open
luiz00martins opened this issue Oct 17, 2023 · 0 comments
Open

Schema Mapping Validation Between JSON Schemas #2338

luiz00martins opened this issue Oct 17, 2023 · 0 comments

Comments

@luiz00martins
Copy link

What version of Ajv are you using?

8.11.2

What problem do you want to solve?

I need to validate one JSON schema against another to ensure they map onto each other based on their description. I'll be using one schema for output of a process and another for input into another process in my system, which would necessitate a validation check to ensure they align correctly.

Note: I considered the idea of doing it dynamically (i.e. checking against the actual output of the process, instead of the schemas). However, I need to detect a possible mismatch before any processing happens.

What do you think is the correct solution to the problem?

Implementing a Schema Mapping Validation feature between JSON schemas could do it. For instance:

  1. A string schema A maps onto a string schema B if it meets the length and pattern requirements of B.
  2. An object schema A fits onto object schema B if it encompasses at least the same required properties as B.
  3. A null schema A maps onto any schema B if B also includes null as an allowable type.

Will you be able to implement it?

I might be able to implement it, although I am unsure about the complexity within the library's framework. However, I am certainly willing to give it a shot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants
@luiz00martins and others