-
Notifications
You must be signed in to change notification settings - Fork 25
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
Suggestion: support exported json:
-tag-less fields to fully reflect / align-with Go's actual json.Marshal
behavior
#90
Comments
json:
-tag-less fields to fully reflect / align-with Go's actual json.Marshal
behaviorjson:
-tag-less fields to fully reflect / align-with Go's actual json.Marshal
behavior
OK found a workaround via: myreflo.JSONSchemaReflector().DefaultOptions = append(myreflo.JSONSchemaReflector().DefaultOptions, jsonschema.ProcessWithoutTags) Guess that closes this Issue (your call! =), though this progress now has me stuck on #91 ... |
Thank you for raising this issue, tagless JSON behavior is indeed important aspect. And unfortunately might be not smooth enough in this library. One of the potential problems (as far as I remember, did not check the code on this) is that in some places there are checks like Please feel free to share more issues/details on your experience with tagless approach, it would be very useful to inform proper implementation. |
Ah, in that case, might be best to "capture them" earliest right during the first struct |
Done in #93. |
Glad this exists and is in such mature shape!
Would you be open to (implementing, or a PR implementing) support for
json:
-tag-less struct fields for request/response structs?There are surely a few
encoding/json
users other than me out there who are quite fine with the standard upper-case naming beingMarshal
ed for exported fields withoutjson:
tags, and don't need or want to ensure the more-common "js(on) field camelCasing aesthetic", and don't want to busy themselves with the endless chore of field-tag maintenance (linter-assisted or not).Right now, for
openapi31
to emit something (that shows up in the swagger-ui-ish rendition of editor-next.swagger.io) for one'sAddReqStructure
/AddRespStructure
calls, those tags are necessary — imho unnecessarily.The text was updated successfully, but these errors were encountered: