Skip to content

fix(validation): skip email validation when the types.Email is nullab…#1107

Merged
1 commit merged intooapi-codegen:masterfrom
henripqt:fix-skip-email-validation-nullable-email
Jul 28, 2023
Merged

fix(validation): skip email validation when the types.Email is nullab…#1107
1 commit merged intooapi-codegen:masterfrom
henripqt:fix-skip-email-validation-nullable-email

Conversation

@henripqt
Copy link
Copy Markdown
Contributor

WHAT:

  • skip email validation when unmarshaling a *types.Email with a nil value
  • add more tests & a sentinel error

WHY:

Currently validation is performed when unmarshaling empty emails even when it shouldn't (using a pointer type is akin to a nullable JSON field and therefore shouldn't be validated). This results in being unable to retrieve data using the generated client if the target API returns a null email in the payload even when this one isn't required.

HOW:

  • skip email validation when unmarshaling a *types.Email with a nil value

@kayn1
Copy link
Copy Markdown

kayn1 commented Jun 13, 2023

👌 👍

@henripqt henripqt requested a review from kayn1 June 24, 2023 18:52
@ghost ghost merged commit 3c2c347 into oapi-codegen:master Jul 28, 2023
debuggerpk pushed a commit to breuHQ/oapi-codegen that referenced this pull request Sep 18, 2023
…le and the email isn't provided (oapi-codegen#1107)

Co-authored-by: Henri Parquet <henri.parquet@banked.com>
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
…le and the email isn't provided (oapi-codegen#1107)

Co-authored-by: Henri Parquet <henri.parquet@banked.com>
This pull request was closed.
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

Successfully merging this pull request may close these issues.

2 participants