You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project that uses entgo and its associated extension entoas to generate a schema specification using ogen. It does this by using the ent graph, which has all type information and annotations to control what to add and exclude from the specification. This works relatively well today, however, it currently isn't possible to add OpenAPI extensions (x-<etc>) to the spec, and have it be marshalled to JSON.
This looks to be due to the json:"-" struct tags on all of the related extension fields, for example:
I suspect this is due to encoding/json not supporting inlining for non-embedded fields, however, I am wondering if there is a way around this (maybe marshal to yaml, then to json in all MarshalJSON() methods, if the yaml encoder supports inlining? Maybe go-faster/jx could be used (or may be overkill?)
References
n/a
The text was updated successfully, but these errors were encountered:
Description
I have a project that uses entgo and its associated extension entoas to generate a schema specification using ogen. It does this by using the ent graph, which has all type information and annotations to control what to add and exclude from the specification. This works relatively well today, however, it currently isn't possible to add OpenAPI extensions (
x-<etc>
) to the spec, and have it be marshalled to JSON.This looks to be due to the
json:"-"
struct tags on all of the related extension fields, for example:ogen/spec.go
Lines 83 to 84 in b41f78c
I suspect this is due to
encoding/json
not supporting inlining for non-embedded fields, however, I am wondering if there is a way around this (maybe marshal to yaml, then to json in allMarshalJSON()
methods, if the yaml encoder supports inlining? Maybego-faster/jx
could be used (or may be overkill?)References
n/a
The text was updated successfully, but these errors were encountered: