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

entoas: handle nillable fields #423

Merged
merged 3 commits into from
Jan 2, 2023
Merged

entoas: handle nillable fields #423

merged 3 commits into from
Jan 2, 2023

Conversation

masseelch
Copy link
Collaborator

Thid PR adds support for Optional() and Nillable() fields. There are three cases to handle:

  1. Optional()
    This field has to be non-required in a POST request body and the model itself.

  2. Nillable()
    This field has to be required in a request body, but the result (model) might contain a (database) NULL value.

  3. Optional() and Nillable()
    Same as 1.

@masseelch masseelch requested review from a8m and giautm January 2, 2023 08:20
Copy link
Collaborator

@giautm giautm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,

@masseelch masseelch merged commit 9abfc72 into master Jan 2, 2023
@masseelch masseelch deleted the entoas/nilable branch January 2, 2023 08:56
giautm pushed a commit that referenced this pull request Feb 15, 2023
* entoas: handle nillable fields

* go mod tidy

* go generate
giautm pushed a commit that referenced this pull request Feb 15, 2023
* entoas: handle nillable fields

* go mod tidy

* go generate
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