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

Question regarding to SchemaProps.ID #23

Closed
rmohr opened this issue Mar 17, 2017 · 2 comments · Fixed by #185
Closed

Question regarding to SchemaProps.ID #23

rmohr opened this issue Mar 17, 2017 · 2 comments · Fixed by #185
Labels

Comments

@rmohr
Copy link

rmohr commented Mar 17, 2017

If I look at the SchemaProps definition, I see that the ID is marshalled into json:

type SchemaProps struct {
	ID                   string            `json:"id,omitempty"`
}

Is there a specific reason for that? Because when I marshal the definitions to json, this ID is also added, but according to openapi the id field is not part of the spec and the validation in some validators fails.

Can we change that to json:"-,omitempty" or is there another way of marshalling the spec?

/cc @emicklei @wsong

@casualjim
Copy link
Member

I found jsonschema compatibility more important. Do you have a concrete example of a validator that fails?

@rmohr
Copy link
Author

rmohr commented Mar 22, 2017

Sorry for the late response.

Examples are:

You can pass in the petshop example and add the id field there.

They do a schema validation too and since it is not part of the schema, they complain about it.

fredbi added a commit to fredbi/spec that referenced this issue Jan 9, 2024
These discussion threads are valuable, but no longer active.

* fixes go-openapi#164
* fixes go-openapi#23

Signed-off-by: Frederic BIDON <[email protected]>
fredbi added a commit that referenced this issue Jan 9, 2024
These discussion threads are valuable, but no longer active.

* fixes #164
* fixes #23

Signed-off-by: Frederic BIDON <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants