Problem
Format2MissingClass is listed as a schema-decode-enforced rule, but the current pydantic models accept Format2 workflows missing the class: GalaxyWorkflow field under both lax and strict validation.
Repro
from gxformat2.schema.gxformat2 import GalaxyWorkflow as Lax
from gxformat2.schema.gxformat2_strict import GalaxyWorkflow as Strict
wf = {
"inputs": {"x": {"type": "File"}},
"outputs": {"o": {"outputSource": "cat/out_file1"}},
"steps": {"cat": {"tool_id": "cat1", "in": {"input1": "x"}}},
}
Lax.model_validate(wf) # passes
Strict.model_validate(wf) # passes — should fail
Root cause
gxformat2/schema/gxformat2_strict.py:498 (and gxformat2.py:482):
class_: Literal["GalaxyWorkflow"] = Field(default="GalaxyWorkflow", alias="class")
The default= makes the field optional. The source schema schema/v19_09/workflow.yml:852 declares class as a required enum — no default/null intended.
Impact
- Schema-rule catalog cannot anchor
Format2MissingClass with a negative fixture — the rule was dropped from gxformat2/schema_rules.yml in the initial landing because negatives pass validation.
- Downstream consumers relying on decode to reject class-less Format2 documents currently get silent acceptance.
Proposed fix
Remove the default= from the generated class_ field for GalaxyWorkflow in both lax and strict models. This likely means adjusting the schema-salad-plus-pydantic codegen (or the source schema annotation) so closed-enum single-symbol fields emit as required Literal[...] without a default.
Same concern may apply to SubworkflowMissingSteps — nested subworkflow validates with empty/missing steps. Worth auditing in the same fix.
Problem
Format2MissingClassis listed as a schema-decode-enforced rule, but the current pydantic models accept Format2 workflows missing theclass: GalaxyWorkflowfield under both lax and strict validation.Repro
Root cause
gxformat2/schema/gxformat2_strict.py:498(andgxformat2.py:482):The
default=makes the field optional. The source schemaschema/v19_09/workflow.yml:852declaresclassas a required enum — no default/null intended.Impact
Format2MissingClasswith a negative fixture — the rule was dropped fromgxformat2/schema_rules.ymlin the initial landing because negatives pass validation.Proposed fix
Remove the
default=from the generatedclass_field forGalaxyWorkflowin both lax and strict models. This likely means adjusting the schema-salad-plus-pydantic codegen (or the source schema annotation) so closed-enum single-symbol fields emit as requiredLiteral[...]without a default.Same concern may apply to
SubworkflowMissingSteps— nested subworkflow validates with empty/missingsteps. Worth auditing in the same fix.