Fatal1ty / mashumaro

Fast and well tested serialization library
Apache License 2.0
774 stars 45 forks source link

When generating a jsonschema, use "description" in field metadata #125

Closed gshank closed 1 year ago

gshank commented 1 year ago

Is your feature request related to a problem? Please describe. We've labeled our jsonschema objects with descriptions in field metadata:

    project_name: Optional[str] = field(                           
        default=None,                    
        metadata={                                                     
            "description": "Name of the root project",
        },
    )    

It would be nice if we could do the same thing using mashumaro's json schema generation.

I guess we could post-process the jsonschema object instead. I see that it's also available in the json_schema["properties"] config, but I think that only works if you want to replace the complete json_schema which isn't feasible.

Fatal1ty commented 1 year ago

Having "description" key in field metadata looks conventional. I'll take it.