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

Any plans for backward conversion? #176

Open
tmargot opened this issue Jan 19, 2024 · 5 comments
Open

Any plans for backward conversion? #176

tmargot opened this issue Jan 19, 2024 · 5 comments

Comments

@tmargot
Copy link

tmargot commented Jan 19, 2024

Apologies if the wrong place for a question, but did not see a different place/link to ask one.
My current requirements are to convert from Draft 6 to Draft4. Any plans for backward conversion?

@jviotti
Copy link
Member

jviotti commented Jan 19, 2024

Hey @tmargot ,

I considered (and attempted) to perform downgrades, but they didn't work very well apart from simple cases, as each version of JSON Schema introduced functionality that cannot be fully represented in previous versions.

My current requirements are to convert from Draft 6 to Draft4

Why do you need to downgrade on the first place? Can you show me some example schemas that you want to downgrade? Just want to understand the level of "lossy-ness" that we could in theory provide

@tmargot
Copy link
Author

tmargot commented Jan 20, 2024

Hi @jviotti,

Thanks for the reply, our integration platform is Boomi (https://boomi.com/) which currently only supports JSON Schema Draft 3/4 for JSON profile import. Our current integration project has NetSuite REST API as a source and the NetSuite metadata (schema) endpoint only returns Draft 6.

https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157373386674.html#The-REST-API-Browser
https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2023.2/index.html

I have looked at https://json-schema.org/draft-06/json-schema-release-notes#q:-what-are-the-changes-between-draft-04-and-draft-06 but was looking for a reliable tool instead of editing by hand.

I have attached a hand modified NetSuite Subscription schema that I removed all company specific custom fields and Ids.

I keep seeing mentions of backward compatibility between Draft 4 and 6, is this true?

I also noted that Boomi requires the user to select the object to be imported as a profile, so I had to include the following:
"$id": "https://1013642-sb3.suitetalk.api.netsuite.com/services/rest/record/v1/metadata-catalog/subscription", "title": "Subscription", "description": "A subscription in the catalog",

NS Subscription Schema Draft 6 Edited.json

@gregsdennis
Copy link

I would take the opportunity to press them to support later schema versions. Let them know that draft 4 is a decade old.

@tmargot
Copy link
Author

tmargot commented Jan 22, 2024

I would take the opportunity to press them to support later schema versions. Let them know that draft 4 is a decade old.

Honestly, we all know, easier said than done. Just trying to work with what I got.

@jviotti
Copy link
Member

jviotti commented Jan 22, 2024

Hi @tmargot ,

Thanks for the detailed response.

Thanks for the reply, our integration platform is Boomi (https://boomi.com/) which currently only supports JSON Schema Draft 3/4 for JSON profile import. Our current integration project has NetSuite REST API as a source and the NetSuite metadata (schema) endpoint only returns Draft 6.

I see. Sadly not an uncommon scenario. I've seen similar cases before.

I have attached a hand modified NetSuite Subscription schema that I removed all company specific custom fields and Ids.

Note that this is also a HyperSchema document, which AlterSchema doesn't even support yet. It currently upgrades JSON Schema, but HyperSchema vocabularies remain unimplemented.

That said, I'm hoping to revamp this project soon for a lot more advanced functionality, including HyperSchema.

I have looked at https://json-schema.org/draft-06/json-schema-release-notes#q:-what-are-the-changes-between-draft-04-and-draft-06 but was looking for a reliable tool instead of editing by hand.

Do you need to be able to do it automatically or do you just need reliability?

Depending on what you need, at https://www.Intelligence.AI, we do some consultancy around JSON Schema (we are publishing an O'Reilly book covering JSON Schema too) and this could be something we can help on:

  • Help you improve those schemas, as I think you are using some invalid keywords. For example nullable is not valid on Draft6
  • Downgrading schemas is often tricky, and easier to do on a case by case basis. We can manually downgrade for you and make sure the downgraded schemas are as lossless as possible.
  • If you need to do it automatically, we could discuss us building some more custom for you to perform these transformations, based on the JSON Schema tooling we have here at Sourcemeta

Happy to discuss further via e-mail or LinkedIn.

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

3 participants