Comments (3)
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.
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.
Closing this issue, since there has not been any activity for a while.
from utoipa.
Related Issues (20)
- Keep serde skipped field in API Spec
- Could utoipa support nesting of ApiDoc definitions? HOT 4
- Wrap property example value in double quotes to avoid hex string being evaluated as a number?
- Use include_str! in the openapi's tag definition
- Generic schemas? HOT 1
- Filter by tag HOT 1
- Allow multiple tags
- `IntoParams` doesn't respect `required` field.
- `params` unsuable in actix (they do not get passed to actix) HOT 1
- [Feature Request] Custom Args and More
- Extending the openapi JSON
- Rapidoc OAuth redirect URL doesn't work
- Update swagger-ui
- Idea: A "strict mode" for component schemas HOT 2
- How generate body with other Json struct HOT 1
- Missing references for ToSchema when types are defined in dependencies HOT 3
- Using openapi documetation without web framework. HOT 2
- Is it possible to accept multiple content-types for requests? HOT 4
- Can't derive `ToSchema` for maps whose value type is an `Option<Enum>`
- Schema name configuration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from utoipa.