common-workflow-language / schema_salad

Semantic Annotations for Linked Avro Data
https://www.commonwl.org/v1.2/SchemaSalad.html
Apache License 2.0
72 stars 62 forks source link

[dlang] Support extention objects in arrays and the `default` field #825

Closed tom-tan closed 1 month ago

tom-tan commented 4 months ago

This request contains the following improvements to dlang codegen.

[Implemented] Support extension objects in arrays

The current dlang code-generated parser rejects the extension objects such as cwltool:CUDARequirement in the requirement field. This request is to accept such extension objects in parser level.

Note: Extension fields such as https://schema.org/name as explained in the user guide are already supported in schema-salad-d level without changing dlang codegen.

[Implemented] Support the default field

The current dlang codegen ignores the default field. Therefore schema-salad-d cannot generate the code to set the default value from the declaration. This request is to fix this issue by adding the @defalultValue attribute to the generated field declarations.

[Implemented] Support MapSchema

[Implemented] Support UnionSchema

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 85.48387% with 9 lines in your changes missing coverage. Please review.

Project coverage is 83.05%. Comparing base (9a92ffc) to head (d23f263). Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
schema_salad/dlang_codegen.py 85.48% 4 Missing and 5 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #825 +/- ## ========================================== + Coverage 83.03% 83.05% +0.01% ========================================== Files 22 22 Lines 4834 4886 +52 Branches 1310 1326 +16 ========================================== + Hits 4014 4058 +44 - Misses 545 548 +3 - Partials 275 280 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tom-tan commented 1 month ago

Done! I confirmed that the D parser generated from the latest schemas for CWL v1.0, v1.1 and v1.2, and schema-salad-d (HEAD) can parse whole CWL documents listed in cwl-d-auto.

I will do some tweaks to make CI passed.

tom-tan commented 1 month ago

Now ready to merge!

tom-tan commented 1 month ago

Thanks!