-
Notifications
You must be signed in to change notification settings - Fork 189
feat(odcs custom export) #815
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
base: main
Are you sure you want to change the base?
feat(odcs custom export) #815
Conversation
- Update README to document usage of --spec with custom export and template variables. - Add CLI validation to prevent usage of --spec with formats other than custom. - Add/adjust tests to ensure CLI rejects --spec with non-
…s with anything else than --format custom
| data_contract_file: str = None, | ||
| data_contract_str: str = None, | ||
| data_contract: DataContractSpecification = None, | ||
| data_contract: DataContractSpecification | OpenDataContractStandard = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change would require a switch in all instance methods, in particular in test() methods.
It feels correct that we should support ODCS spec in the DataContract class. However introducing this in would be a major enhancement (and this PR is a bit specific).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @simonharrer
| def export(self, export_format: ExportFormat, model: str = "all", sql_server_type: str = "auto", **kwargs) -> str: | ||
| if export_format == ExportFormat.html or export_format == ExportFormat.mermaid: | ||
| def export(self, export_format: ExportFormat, model: str = "all", spec: Spec = Spec.datacontract_specification, sql_server_type: str = "auto", **kwargs) -> str: | ||
| if export_format == ExportFormat.html or export_format == ExportFormat.mermaid or spec == Spec.odcs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should enable the new resolve logic (v2) also for ExportFormat.custom. We do not need the spec as a parameter here.
| Optional[Path], | ||
| typer.Option(help="[custom] The file path of Jinja template."), | ||
| ] = None, | ||
| spec: Annotated[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need the parameter, as we can automatically detect whether a YAML file is DCS or ODCS. Supporting a jinja template that can handle DCS and ODCS is not something we want to support. And it could be implemented with an instance of check anyway without this parameter.
|
@gautierc-thelio thanks for your contribution! This is really important, and long overdue. We can simplify the implementation quite a bit, by staying close to how the HTML export itself is implemented. We do not need the |
|
Can you incorporate the requested changes into this PR? |
Closes #814