erasmus-without-paper / ewp-specs-api-iias

Specifications of EWP's Interinstitutional Agreements API.
MIT License
4 stars 13 forks source link

Get-response xml Validation fails when terminated-as-a-whole node is present #145

Closed brankopetric closed 1 year ago

brankopetric commented 1 year ago

When terminated-as-a-whole node is added in get-response-example.xml

...
</staff-training-mobility-spec>
<terminated-as-a-whole>true</terminated-as-a-whole>
</cooperation-conditions>
...

and validated against get-response.xsd schema

I'm getting validation error like this: Element '{https://github.com/erasmus-without-paper/ewp-specs-api-iias/blob/stable-v7/endpoints/get-response.xsd}terminated-as-a-whole': This element is not expected. Expected is ( {https://github.com/erasmus-without-paper/ewp-specs-api-iias/blob/stable-v7/endpoints/get-response.xsd}staff-training-mobility-spec ).

Maybe xsd needs some tweaking?

janinamincer-daszkiewicz commented 1 year ago

Which validator are you using and where? Have you been participating in today's Infrastracture Forum meeting?

brankopetric commented 1 year ago

No I skip Infrastracture Forum meeting.

I am using default PHP SchemaValidator validator but also test in few online tools.

janinamincer-daszkiewicz commented 1 year ago

Today during IF I presented what is the status of the on-line Validators. Schema Validator ready for 7.0 is available in the DEV Registry. Other validators will be updated in the coming days. You can find presentation from today's meeting here: https://esci-sd.atlassian.net/wiki/spaces/ITSC/pages/113999873/Infrastructure+Forum+and+technical+workshops.

brankopetric commented 1 year ago

Thats great to hear :)

But even schema validator on DEV Registry report error when true is present in get-response.xml.

cvc-complex-type.2.4.a: Invalid content was found starting with element '{"https://github.com/erasmus-without-paper/ewp-specs-api-iias/blob/stable-v7/endpoints/get-response.xsd":terminated-as-a-whole}'. One of '{"https://github.com/erasmus-without-paper/ewp-specs-api-iias/blob/stable-v7/endpoints/get-response.xsd":staff-training-mobility-spec}' is expected.

So problem is with get-response.xsd schema in documentatio

janinamincer-daszkiewicz commented 1 year ago

Michał will look into it (probably tomorrow).

brankopetric commented 1 year ago

Thanks!

mkurzydlowski commented 1 year ago

@brankopetric, terminated-as-a-whole is an attribute not an element: https://github.com/erasmus-without-paper/ewp-specs-api-iias/blob/v7.0.0/endpoints/get-response.xsd#L232-L240

You should set it like this: <cooperation-conditions terminated-as-a-whole="true">

brankopetric commented 1 year ago

My bad, Thanks.