Open paule96 opened 1 year ago
Hi @paule96,
Thank you for raising this. The REST endpoint support we enabled so far tries to adhere to the Microsoft REST API guidelines here. And we indeed added OData style $filter
clauses. However, we haven't completely added the OData support. This would be a new feature request and not considered as a bug.
In the meantime, if you are interested in getting the metadata of the exposed REST endpoints, you could retrieve the OpenAPI document which the latest version of Data API builder - 0.7.6 - generates. This OpenAPI description document (also referred to as a schema file) is generated using the developer provided runtime config file and the database object metadata for each REST enabled entity defined in the runtime config file. The schema file is generated using functionality provided by the OpenAPI.NET SDK. Currently, the schema file is generated in adherence to OpenAPI Specification v3.0.1 formatted as JSON.
The OpenAPI description document can be fetched from Data API builder from the path:
GET /{rest-path}/openapi
In Development mode, Data API builder enables viewing the generated OpenAPI description document from a dedicated endpoint:
GET /swagger
Uff yes I realize now that many things from OData are missing, like expand... So maybe we should relable the issue to an epic to bring most of the odata funcitons to the odata builder.
For example what I was trying was the $expand
option in odata. (/rest) It's not working too. In the graphql
endpoint there are no problems for that. (if you define the relation between your entities)
Just to have the correct informations, if I want to implement the metadata document the following things are a todo:
EdmModelBuilder
RestController
or inside the RestService
logic to responde to the $metadata
pathThis work would enable also the implementation of $expand
inside the RequestParser
, because the relations are required for the metadata endpoint, and can be accessed then by the rest of the framework. The important thing for the implementation of the $expand
stuff is to respect the permissions of the user.
What happened?
The
/rest/...
of the genereated API contains at the end technically an ODATA endpoint. But the problem is for many API tools is, that the generated part doesn't make the$metadata
endpoint accessible. This endpoint is for example used in PowerBi to be connected to an OData API and get the schema and all valid endpoints from it.So my expactation would be that I could call:
rest/$metadata
and get the XML schema of the OData feed back.Currently I get:
Version
Azure Static Web Apps CLI (1.1.3)
What database are you using?
Azure SQL
What hosting model are you using?
Static Web Apps (SWA)
Which API approach are you accessing DAB through?
REST
Relevant log output
No response
Code of Conduct