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

Type Date must be string according to the OpenAPI specification #42

Open
vadim-mve opened this issue Mar 18, 2024 · 0 comments
Open

Type Date must be string according to the OpenAPI specification #42

vadim-mve opened this issue Mar 18, 2024 · 0 comments

Comments

@vadim-mve
Copy link
Contributor

Underlying type of Date is null.Time and this causes problems with go-oas3 which generates invalid code like this

func (body Payer) Validate() error {
	return validation.ValidateStruct(&body,
		validation.Field(&body.BirthDate, validation.Skip.When(body.BirthDate == ""), validation.RuneLength(10, 10)))
}

validation.Skip tries to compare null.Time to ""

Invalid code generated here:
https://github.com/mikekonan/go-oas3/blob/main/generator/generator.go#L580

According to specification underlining type of Date must be string

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