Skip to content

Conversation

@FedericoNegri
Copy link
Contributor

@FedericoNegri FedericoNegri commented Sep 2, 2022

With this approach, we get a more accessible (in-code) and PyAnsys-compliant doc
resources_doc

and code completion

resources_code_completion

Not to mention that the tedious code for the resource objects is automatically generated. In the future, we could consider extracting the schema from the openapi spec.


As an alternative (or next-step) approach, we could consider replacing marshmallow with pydantic, which has a nice command-line utility to generate pydantic models from an openapi spec. Moving to pydantic would allow to merge schema and resource objects (example for JMS here). However, it requires some more work to fit some of our cases (ParameterDefinition objects, load_only attributes, equivalent of marshmallow missing).

@github-actions github-actions bot added dependencies Related with project dependencies documentation Improvements or additions to documentation labels Sep 2, 2022
@FedericoNegri FedericoNegri marked this pull request as ready for review September 5, 2022 07:43
@FedericoNegri FedericoNegri merged commit 97b7393 into main Sep 6, 2022
@FedericoNegri FedericoNegri deleted the fnegri/generate_resources branch September 8, 2022 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Related with project dependencies documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants