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

Add support for custom templates and extra template data #71

Merged
merged 2 commits into from
Oct 16, 2019

Conversation

joshbode
Copy link
Contributor

  • point to a directory containing template overrides
    (BaseModel.jinja2, etc)
  • add custom data to templates for rendering from JSON file to support
    incorporating data that exists outside of openapi spec

@codecov
Copy link

codecov bot commented Oct 15, 2019

Codecov Report

Merging #71 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #71   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines         625    644   +19     
  Branches      121    124    +3     
=====================================
+ Hits          625    644   +19
Impacted Files Coverage Δ
datamodel_code_generator/model/pydantic/types.py 100% <100%> (ø) ⬆️
datamodel_code_generator/__main__.py 100% <100%> (ø) ⬆️
...tamodel_code_generator/model/pydantic/dataclass.py 100% <100%> (ø) ⬆️
datamodel_code_generator/model/base.py 100% <100%> (ø) ⬆️
..._code_generator/model/pydantic/custom_root_type.py 100% <100%> (ø) ⬆️
...amodel_code_generator/model/pydantic/base_model.py 100% <100%> (ø) ⬆️
datamodel_code_generator/parser/openapi.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30ae213...ea6e72b. Read the comment docs.

- point to a directory containing template overrides
  (`BaseModel.jinja2`, etc)
- add custom data to templates for rendering from JSON file to support
  incorporating data that exists outside of openapi spec
@koxudaxi
Copy link
Owner

I feel good.

@koxudaxi koxudaxi merged commit 5697b69 into koxudaxi:master Oct 16, 2019
@koxudaxi
Copy link
Owner

Thank you very much.

@joshbode joshbode deleted the custom-templates branch October 16, 2019 07:19
@joshbode
Copy link
Contributor Author

Awesome - thank you again for accepting

  • sorry for the chain of PRs - I'm working up to something bigger (hint: it's an API client :)

@koxudaxi
Copy link
Owner

@joshbode

No problem :)

(hint: it's an API client :)

Will it be opened? (it's interesting)

I want to develop a code generator for a server of fastapi and client.
But, I'm busy with another project.

@joshbode
Copy link
Contributor Author

yes, I hope so :)

it's for an internal project at the moment (and as such is a little idiosyncratic, hence the desire to be able to modify templates a little, and inject some extra data) but as things settle down, I'll try to roll more of my steps back into the generator :)

@koxudaxi
Copy link
Owner

koxudaxi commented Oct 16, 2019

If I will develop a code generator(maybe for server, client) then, I will ping you. because we should save the resource to develop :)

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

Successfully merging this pull request may close these issues.

2 participants