Skip to content
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

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

Closed
gshank opened this issue Jul 18, 2023 · 1 comment · Fixed by #127
Closed

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

gshank opened this issue Jul 18, 2023 · 1 comment · Fixed by #127
Labels
enhancement New feature or request

Comments

@gshank
Copy link
Contributor

gshank commented Jul 18, 2023

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants