You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support conversion of cyclic types to JSON Schema #1087
Awesome! As a first step, we should plan out what we want the behavior here to be. We can convert a type and all of its references to JSON schema. I guess the way to do it would be to have the Type we're directly converting as the top-level definition, then a defs key with its references mapped to corresponding JSON schema?
The change itself will need to made in @ark/schema. Cyclic types will have an Alias node where they cycle, so this would be the toJsonSchema method you'd need to change to accommodate this. A node's references can be found under the .references property.
Feel free to let me know if you have additional questions- dealing with cyclic types in any system can be tricky!
Activity
donovandicks commentedon Feb 3, 2025
👋 This issue is relevant to some work I'm doing. I'm interested in contributing, will take a look at the guide.
ssalbdivad commentedon Feb 3, 2025
Awesome! As a first step, we should plan out what we want the behavior here to be. We can convert a type and all of its references to JSON schema. I guess the way to do it would be to have the Type we're directly converting as the top-level definition, then a
defskey with its references mapped to corresponding JSON schema?The change itself will need to made in
@ark/schema. Cyclic types will have anAliasnode where they cycle, so this would be thetoJsonSchemamethod you'd need to change to accommodate this. A node's references can be found under the.referencesproperty.Feel free to let me know if you have additional questions- dealing with cyclic types in any system can be tricky!