oasis-open / odata-rapid

Rapid - Specification, tools and libraries to support the development and adoption of simple REST-based APIs.
https://rapid.rocks
Apache License 2.0
17 stars 8 forks source link

API-Explorer should support odata services that only support application/xml #414

Closed mikepizzo closed 2 years ago

mikepizzo commented 2 years ago

we can translate the xml response to json in the tool.

could also consider adding a CSDL-XML tab to the explorer (or at least to export)

mikepizzo commented 2 years ago

Note that there is code in api-explorer to support XML-only services. However, some of the older V4 "reference" services (i.e.; https://services.odata.org/V4/(S(aij4w0u4kwolos1artce5euu))/OData/OData.svc/) returns an invalid "ConcurrencyMode" attribute.

In addition to fixing those reference services, we should improve debugging and perhaps make reading the schema more robust/tolerant.

ralfhandl commented 2 years ago

Which package is tripping over the ConcurrencyMode attribute?

mikepizzo commented 2 years ago

@ralfhandl -- fresh build with most recent sources no longer exhibits the behavior; did something get fixed in one of the dependent libraries?

ralfhandl commented 2 years ago

@mikepizzo using this reference service in the API Explorer on https://rapid.rocks/api-explorer/index.html produces this error message in the CSDL pane:

{"error":{"code":"","message":"Unsupported media type requested.","innererror":{"message":"A supported MIME type could not be found that matches the acceptable MIME types for the request. The supported type(s) 'application/xml' do not match any of the acceptable MIME types 'application/json'.","type":"Microsoft.OData.Core.ODataContentTypeException"}}}
ralfhandl commented 2 years ago

The CSDL XML-to-JSON converter now runs in non-strict mode by default, silently ignoring unexpected XML attributes: https://github.com/oasis-tcs/odata-csdl-schemas/blob/main/CHANGELOG.md#060-2022-08-31, and we are using this version 0.6.0

mikepizzo commented 2 years ago

Closing as resolved.