-
Notifications
You must be signed in to change notification settings - Fork 81
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
SAP OData missing __metadata property #60
Comments
That's standard OData V2, you can also see it in the public Northwind V2 service. It is not reflected in $metadata because it is there by default in all V2 "Verbose JSON" responses. It is currently also not reflected in the generated OAS because it always has the same structure, see OData V2 Specification, 2.2.6.3.3 Entity Type (as a JSON Object) |
I see. It's good that it's not a special case, makes things a bit easier :)
I'm using the OAS to generate a client (https://github.com/OpenAPITools/openapi-generator). When the property is missing I have to alter the generated model to include I guess the counter argument is that the openapi-generator should know it's an OAS for an ODATA data source and include these default properties. Not sure which is the better option. |
One could argue that the purpose of the generated OAS is that clients don't need to know about OData. (Did I actually write this? In my opinion everyone should know about OData 😃) I'd be willing to test and merge a pull request if you would want to add that feature. The |
I'll have a look |
Added simple test script https://github.com/oasis-tcs/odata-openapi/blob/master/tools/test.cmd Runs XSLTs for a bunch of test input files and uses git diff to show what has changed. |
|
I'm working with an ODATA endpoint in SAP and I noticed that SAP sends a
__metadata
property which isn't described in the $metadata unfortunately. Not sure if it can be "turned on" via a query parameter. However it's there.I looked though the XSLT scripts and couldn't find a "handler" for the
__metadata
property. Is it possible to add this to the generated OAS when converting a metadata from SAP OData?The reason why the
__metadata
property is relevant is because it contains theetag
value for an entity.The SAP ODATA response looks like this:
The text was updated successfully, but these errors were encountered: