-
-
Notifications
You must be signed in to change notification settings - Fork 864
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
Implement x-inOrder subschema for in order or sequential processing #2403
Comments
I would like to make the x-orderOf property a subschema, but here's an initial approach:
|
Hi @coderextreme, thanks for your interest in AJV. I am not sure I completely understand the problem yet, but I wonder, have you looked into the custom keyword feature? I believe you should be able to achieve what you need without any changes to AJV itself. I once wrote a simple form generation function that used custom keywords and the recursive behaviour of AJV to create forms out of custom defined schemas so it should be possible. |
I've bookmarked the page. I'm not sure what we can do for validators
besides Ajv.
Thanks!
…On Wed, Apr 3, 2024 at 5:20 PM Jason Ian Green ***@***.***> wrote:
Hi @coderextreme <https://github.com/coderextreme>, thanks for your
interest in AJV. I am not sure I completely understand the problem yet, but
I wonder, have you looked into the custom keyword
<https://ajv.js.org/keywords.html#define-keyword-with-code-generation-function>
feature?
I believe you should be able to achieve what you need without any changes
to AJV itself. I once wrote a simple form generation function that used
custom keywords and the recursive behaviour of AJV to create forms out of
custom defined schemas so it should be possible.
—
Reply to this email directly, view it on GitHub
<#2403 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFMJ53R6SLCGJ2J2YA5G33Y3R6CDAVCNFSM6AAAAABFQV222OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZVG4YDCNZZG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
What problem do you want to solve?
I want to solve the problem of serializing JSON data to XML, and the XML will comply with sequencing specified in XML schema. In other words, I want to throw out JSON with a JSON schema where properties or subschemas do not match a certain ordering.
I would like to add an ‘x-inOrder’ subschema that applies to properties and subschemas, such that I will have a source of information for serializing properties to XML elements, similar to head element and body element ordering in HTML.
What do you think is the correct solution to problem?
Implement something like allOf, anyOf, oneOf, but do sequential processing on it.
Will you be able to implement it?
I might need help understanding Ajv, but I am fairly competent at JavaScript. I’m a long time Ajv user, and I’ve had a tiny bit of time looking at source to make it work on my platform.
I realize I can save this information elsewhere. But I have collaborator that relies on JSON schema.
The text was updated successfully, but these errors were encountered: