Skip to content

Conversation

@ivan-tymoshenko
Copy link
Member

@ivan-tymoshenko ivan-tymoshenko commented Jun 5, 2022

❗BREAKING CHANGES

This PR uses ajv addSchema and getSchema methods for resolving json schema references. For this, we need to represent schema and external schemas in terms of json schema draft 7.

I think it's a good opportunity to fix some issues.

First of all when we pass external schemas as an object.

const externalSchemas = {
 a: { type: 'number' },
 b: { type: 'string' },
}

What do keys of the object mean in terms of json schema? Are they base URLs for these schemas? If so how should what should happen if we pass the key and $id?

const externalSchemas = {
 a: { $id: 'id1' },
 b: { $id: 'id2' },
}

@ivan-tymoshenko ivan-tymoshenko marked this pull request as ready for review June 5, 2022 10:42
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina
Copy link
Member

mcollina commented Jun 5, 2022

I'm landing this and trying to assemble a release.

@mcollina mcollina merged commit b41b800 into fastify:master Jun 5, 2022
@mcollina
Copy link
Member

mcollina commented Jun 5, 2022

Unfortunately I will need to revert this. It breaks quite a few fastify tests that would need to be updated... and we are running out of time.

Note: technically this is correct and there are other things that would need to updated in Fastify regarding encapsulation to make this work properly.

@mcollina
Copy link
Member

mcollina commented Jun 5, 2022

Feel free to send a fresh PR!

mcollina added a commit that referenced this pull request Jun 5, 2022
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

Successfully merging this pull request may close these issues.

2 participants