I am trying to configure Azure API Management to use versioning and have it work with a Swagger / Open API document generated by Swashbuckle.
I have an API with 2 versions - 1.0 and 2.0. I have configured Swashbuckle to generate 2 seperate Swagger documents, one for each version. All good.
The versioning scheme is by path so consumers need to call the correct path (v1.0 or v2.0). Like so: https://someurl/v1.0/some/thing
I have defined both versions in Azure API Management and imported both documents.
The problem is that Azure API Management is adding the path to the base URL and then because the path that is defined in the Swashbuckle generated Open API document I'm ending up with https://someurl/v1.0/v1.0/some/thing in Azure API Management.
Below is a snippet of the generated Swagger / Open API...
And the API version settings in Azure API Management...
And the full URL in Azure API Management...
So, my questions is how can I generate a Swagger document, using Swashbuckle or any other tool in a way that I can support Azure API Management versioning using the path versioning scheme.
Thank you in advance!
Since OpenAPI specification itself does not allow you to define versioning scheme, it is impossible to infer user intention at APIM level. One may want to import API with /v1.0/ in path as a single API, someone else, like in your case, wants to have API + version set. APIM by default does not create/update version sets during API import, so the only way at the moment is to remove /v1.0 prefixes from OpenAPI spec before you import into APIM.
APIMs domain model allows one to control versioning scheme (path prefix, header name/value, query parameter name/value) at the level of API version set, so that you do not need to duplicate /v1.0 on every operation of your API. By nature of this if your API version set is configured to have path prefix of /v1.0 it will be appended to all API paths included into this version set. And that is what produces the doubling.
Related
Guidewire Policy Center 10.2 self managed. I'd like to create and quote submission for auto policy line.
Is there a rest api for submission creation exposed via the policy center? Based on the documentation I've an impression it should be there but swagger ui doesn't show related api
I found only soap based web service. Now coming to submission api I see it's very generic, it looks policyPeriodData should be a raw xml that contains all the data about drivers, vehicles etc. How can I get such template in an easy way?
Edit:
Using gosu scratchpad I was able to generate sample xml for policy period
var pp = new gw.webservice.pc.pc1000.gxmodel.policyperiodmodel.PolicyPeriod(pd) print(pp.asUTFString())
it contains drivers data but I don't see any api how to pass vehicles data
I have a shared instance of API Management that has two custom domains associated with it. These two custom domains are:
team1Naming.company.com and team2Naming.company.com
Right now when I create a new API it always defaults to using team1Naming.company.com for all APIs. What I want is for all APIs in team1Product to use team1Naming.company.com as the base url and all APIs in team2Product to use team2Naming.company.com as the base url.
Does anyone know how to set a different base url on certain APIs?
I have setup apis in Azure APIm and individual actions are working by their respective url.
I want a Swagger uri of this API which is having azure domain and lists all the actions in it.
For example, by default APIm provides a sample api named "Echo API" whose url becomes: https://testresource.azure-api.net/echo
Now, I understand that there is an option on the API context menu to export it in Swagger format.
But what I am looking for is such a url that render this specifications online:
https://testresource.azure-api.net/echo/swagger
Similar question here have an answer to add an endpoint for swagger/ui/index. Which I believe is having an endpoint in native api and configure as an action. Is there any way APIm generate/provide such a url for already setup APIs?
Thank you MayankBargali-MSFT and Sam Cogan Posting your suggestion as answer to help other community members.
You need to use the Create/Update API to pass in the URL of your swagger file. You can find an example
here.
Unfortunately, API only accepts it as the swagger file while importing the swagger file as documented in the request
body.
You can try uploading your swagger file to your storage account or any
path which is publicly accessible.
Reference: https://learn.microsoft.com/en-us/answers/questions/687043/import-swagger-file-programatically-to-azure-apim.html.
I'm attempting to import a wsdl into Azure APIM and getting an error that the wsdl file can't be parsed, and therefore I don't have a complete list of operations in APIM. If I attempt to import via app service (SOAP APIs) I don't receive an error but the list provided is also not a complete list of operations. When I upload the file I do receive a complete list of operations (without error) but then I am not provided any input parameters when attempting to test in the testing tab of APIM in the portal. Importing the wsdl via a file appears to be most successful option of the 3 but still returns an error. I've imported wsdl before and I don't recall running into this issue. Any idea why this is happening?
FYI... I can use the SOAPUI to test the SOAP api directly without using APIM.
When importing an API, you might come across some restrictions or identify issues that need to be rectified before you can successfully perform the import.
For WSDL below are the points we need :
WSDL files are used to create SOAP pass-through and SOAP-to-REST APIs.
SOAP bindings -Only SOAP bindings of style ”document” and “literal” encoding are supported. There is no support for “rpc” style or SOAP-Encoding.
WSDL:Import - This attribute isn't supported. Customers should merge the imports into one document.
Messages with multiple parts - These types of messages aren't supported.
WCF wsHttpBinding - SOAP services created with Windows Communication Foundation should use basicHttpBinding - wsHttpBinding isn't supported.
MTOM - Services using MTOM may work. Official support isn't offered at this time.
Recursion - Types that are defined recursively (for example, refer to an array of themselves) are not supported by APIM.
Multiple Namespaces - Multiple namespaces can be used in a schema, but only the target namespace can be used to define message parts. Namespaces other than the target, which are used to define other input or output elements, are not preserved. Although such a WSDL document can be imported, on export all message parts will have the target namespace of the WSDL.
For more info, follow this :
https://learn.microsoft.com/en-us/azure/api-management/api-management-api-import-restrictions
We have a custom web service for Acumatica, that we would like to integrate into our extension library. This is a service that accepts data to post into Acumatica (multiple DACs used).
However, I cannot find any information on the proper way to do that.
We use Web API (Api Controller) and route based endpoints, and it is likely that some registration needs to take place when the extension library is loaded.
Any pointers to how this should be done?
b