Git Product home page Git Product logo

Comments (3)

juhaku avatar juhaku commented on May 18, 2024

Yeah.. Actually support for this hasn't been yet implemented. This is something that still need to be addressed in future releases. Currently it indeed bluntly uses snake_case.

from utoipa.

juhaku avatar juhaku commented on May 18, 2024

As what comes to this case feature. I plan to add support to skip fields from serializing to the api doc? It could also be done with that #[serde(skip)] attribute. Is that something you think would be useful?

Also about the rename thing. Yes I guess typically camelCase is involved with the JSON but I guess it mostly depends on with what langauge the actual API's writen and I guess the habits derive from there. Like with Java, JavaScript, TypeScript its indeed most of the time camelCase and with Go it can be PascalCase or camelCase depending whether people really see the trouble to rename manually all the fields. And I gues python goes with the snake_case as well, not sure though.

But ability to support different cases. It should be quite easy to add support for #[serde(rename_all = "...")] at Component level. But it might look jarring if path parameters where in snake_case and other content would be camelCase? For example in actix-web path parameters are defined within macro #[get("/user/{user_id}")] which assumes there is variable user_id within path. And if this was also to be renamed to camelCase the the path should be written like this #[get("/user/{userId}")] and it would definitely alarm somebody about the style.

from utoipa.

juhaku avatar juhaku commented on May 18, 2024

Closing this issue, since there has not been any activity for a while.

from utoipa.

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.