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
[Bug] Go generated structs contain url annotations for every field #2986
Comments
This is actually the annotation that we use to serialize query parameters sent from the SDK. This approach is inspired by Google's go-querystring, but our approach includes a few minor differences and improvements for types specific to Fern.
Now that we support
This is actually something we debated when rolling out the feature to begin with. Including them everywhere upfront will actually enable us to someday roll out a new With all that said, we made the decision to include them everywhere knowing that we could later change the behavior to include them in a stricter subset (like you're suggesting), but I'm still not convinced that we should do that in general (especially with that new upcoming feature in mind). |
Describe the bug
The go model and SDK generators create structs for fern types. Each field in these structs contains a
url
annotation. These annotations are used for type safe URL param parsing in go. As far as I know, this is only useful server-side, so the SDK structs should not contain these annotations at all. These annotations are only useful in request types and so should not be in every model struct. Instead, they should be only in namedrequest
types.To reproduce
Generate any fern type, e.g.,
this results in the struct:
Expected behavior
I would expect the following struct
The struct
GetBar
for the following API endpoint should have theurl
annotations, howeverVersion
Go generator 0.16.0
The text was updated successfully, but these errors were encountered: