-
Notifications
You must be signed in to change notification settings - Fork 72
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
Ability to modify JSON schema property name #83
Comments
Interesting.. I'm curious what your the use case is.. In other words: why do you care how the field name is spelled as long as it's unique, descriptive, and consistent? |
In my case, I essentially have JSON payloads that contain an
I use this I hope it makes sense? 😅 |
Ok, I looked deeper into the issue. The actual entry key name is set here:
Basically, it is not possible to change How about looking for
Then, on
which will result in:
|
Hi,
I have a problem with
marshmallow-jsonschema
where during the translation it uses field names rather that schema attributes.For example, I have a following schema:
If I run
JSONSchema().dump(ExampleSchema()).data
, it will translate to:As you can see, it used the field name (
ExampleSchema.api_token
) from the schema instead of its attribute (api-token
).attribute='api-token'
was used fortitle
in the resulting JSON schema.Originally in the marshmallow core,
attribute
parameter is utilized for marshaling: https://marshmallow.readthedocs.io/en/2.x-line/quickstart.html#specifying-attribute-namesIn my case, I'm just trying to follow PEP8 having
lower_case_with_underscores
variable names in the python code, but then in the resulting JSON schema I would want to followcamelCase
. I was hoping to achieve that specifyingattribute
parameter.Is there some kinda parameter I could pass to JSONSchema to pick schema's attribute instead?
The text was updated successfully, but these errors were encountered: