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

Do not set nullable by default on pointer fields in Structs #16

Open
fhgbaguidi opened this issue Apr 6, 2018 · 0 comments
Open

Do not set nullable by default on pointer fields in Structs #16

fhgbaguidi opened this issue Apr 6, 2018 · 0 comments

Comments

@fhgbaguidi
Copy link
Contributor

The idea behind this issue is to have some open api tags that we can put on fields on structs to tell to openapi-parser that the field is nullable. The field will be set as nullable only if this tag is present and the field is a pointer to something.

Example:

// Pet struct
// @openapi:schema
type Pet struct {
	ID              bson.ObjectId
	PointerOfString *string       `openapi:"nullable"`
	PointerOfStruct *Foo 
}

In this example, only PointerOfString field should be nullable in the generated openapi file.

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

1 participant