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

feat: writeOnly and readOnly added to json tag #453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

enverbisevac
Copy link

Minor improvement to support openapi spec writeOnly and readOnly https://swagger.io/specification/v3/
example:

type User struct {
        ......
        FullName string `json:"full_name"
	Password   Password `json:"password,writeOnly"`

when object is serialized password is not present:

{
    .....
    "full_name": "Admin",
}

@enverbisevac enverbisevac changed the title writeOnly and readOnly tags added to json tag feat: writeOnly and readOnly tags added to json tag Jun 2, 2023
@enverbisevac enverbisevac changed the title feat: writeOnly and readOnly tags added to json tag feat: writeOnly and readOnly added to json tag Jun 2, 2023
@enverbisevac
Copy link
Author

Does anyone have time to look at this PR? or others PRs as well I see no activity for long period of time.

@f3oall
Copy link

f3oall commented Sep 26, 2023

Hey @enverbisevac,

I'm looking forward to this feature as well. Though there can be an issue with scopes, while it makes sense for serializing/deserializing in API scope, JSON is also used in DBs (e.g. PostgreSQL). When you use one structure both for DB and API it can raise a conflict.

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.

None yet

2 participants