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

Missing "id" in 2.0 schema #103

Closed
tlivings opened this issue Sep 11, 2014 · 8 comments
Closed

Missing "id" in 2.0 schema #103

tlivings opened this issue Sep 11, 2014 · 8 comments

Comments

@tlivings
Copy link
Contributor

Is this intentional? What URI should this be registered as, in, for example, schema validators.

@webron
Copy link
Member

webron commented Sep 11, 2014

Are you referring to the "id" in the model/schema definitions? If so, it is indeed intentional. There's no need for it because the key for the definition is the id.

@tlivings
Copy link
Contributor Author

Was actually referring to the top level id attribute of the schema itself.

@webron
Copy link
Member

webron commented Sep 13, 2014

In that case, I don't follow. Can you give a concrete example of what you're referring to?

@tlivings
Copy link
Contributor Author

@tlivings
Copy link
Contributor Author

Just to add something here. id can be used in resolving $ref, as per the spec, here:

http://json-schema.org/latest/json-schema-core.html#anchor26

JSON Schema offers facilities to alter the base URI against which a reference must resolve by the means of the "id" keyword;

[edit] Specifically: http://json-schema.org/latest/json-schema-core.html#anchor28

Containing an id property in this schema, as well as any referenced schema, is generally a good way to inform validators how to look up $ref.

@webron
Copy link
Member

webron commented Oct 13, 2014

Yeah, didn't forget about it, just trying to figure out what would be the right id to give it. I hope to host it under our new swagger.io domain name and that should solve it.

@tlivings
Copy link
Contributor Author

Thanks :) I just wanted to add more detail.

@webron
Copy link
Member

webron commented Oct 13, 2014

That's great, I appreciate it. Always looking to learn more :)

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

2 participants