Git Product home page Git Product logo

Comments (1)

amckinney avatar amckinney commented on June 9, 2024

As far as I know, this is only useful server-side, so the SDK structs should not contain these annotations at all.

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.

These annotations are only useful in request types and so should not be in every model struct.

Now that we support deepObject query parameters (link), it's important that we include url tags in every object contained in the transitive closure from every request type. For example, using your example above, we actually support specifying the User as a query parameter.

Instead, they should be only in named request types.

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 RequestOption that allows us to add arbitrary query parameters to individual endpoints (where the query parameter is not already defined on the API). We haven't needed this feature yet, but it's been discussed a bit here and there so I know it might be on the horizon.

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).

from fern.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.