Skip to content

Missing "id" in 2.0 schema #103

Closed
Closed

Description

@tlivings

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

Activity

  1. webron commented on Sep 11, 2014

    @webron
    Member

    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.

  2. tlivings commented on Sep 12, 2014

    @tlivings
    ContributorAuthor

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

  3. webron commented on Sep 13, 2014

    @webron
    Member

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

  4. tlivings commented on Oct 13, 2014

    @tlivings
    ContributorAuthor

    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.

  5. webron commented on Oct 13, 2014

    @webron
    Member

    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.

  6. tlivings commented on Oct 13, 2014

    @tlivings
    ContributorAuthor

    Thanks :) I just wanted to add more detail.

  7. webron commented on Oct 13, 2014

    @webron
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions