Add support for OData API endpoints in extractor and publisher
Azure APIM added OData support in July 2024, but apiops tooling could not extract or publish OData APIs. This prevents proper GitOps workflows for services using OData endpoints.
Changes
Core specification support
- Added
ApiSpecification.ODatatype andODataSpecificationFileclass - OData metadata stored as
specification.xml(XML format, similar to WSDL)
Extractor
- Detects APIs with
apiType: "odata"and exports metadata usingformat=odataparameter - Handles OData alongside WSDL/WADL in XML export fallback logic
Publisher
- Implements
PutODataApi()method using Azure APIM's import flow (import=true,format: "odata") - Routes OData APIs through specialized import handler (similar to SOAP APIs)
- Adds
specification.xmlto recognized specification filenames for API/workspace contexts
Implementation
OData import follows the same pattern as SOAP APIs - two-step process with initial import then metadata update:
// Step 1: Import with specification
var odataUri = uri.ToUri().SetQueryParam("import", "true").ToUri();
var odataDto = new ApiDto {
Properties = new ApiDto.ApiCreateOrUpdateProperties {
Format = "odata",
Value = dto.Properties.Value,
ApiType = "odata",
// ... other properties
}
};
// Step 2: Update without specification
var updatedDto = dto with { Properties = dto.Properties with { Format = null, Value = null } };
Resolves #[issue_number]
Original prompt
This section details on the original issue you should resolve
<issue_title>[FEATURE REQ] Support ODATA endpoints</issue_title> <issue_description>### Please describe the feature.
Support importing/exporting of the OData endpoints within APIM Management. At the moment, it does not retrieve or publish all of the details stored in APIM when you create an OData endpoint</issue_description>
Comments on the Issue (you are @copilot in this section)
@waelkdouh Support for odata was just added to Azure APIM in July so we haven't had the chance to add support for it under apiops yet.
- Fixes Azure/apiops#419
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.