Open rohit3d2003 opened 1 year ago
@rohit3d2003 - thanks, I was able to reproduce the behavior. Looks like the APIM REST API sets things to the base URL if you don't explicitly pass a null
service URL.
Is that causing any issues for you? I would expect the set-backend-service
policy to still override things correctly.
In any case, we'll have the extractor explicitly set serviceUrl: null
if you don't pass a Web Service URL.
@guythetechie - It's not causing an issue for us but my team members got confused seeing this on the portal. Love to have it fixed
It unfortunately looks like this behavior is by design in APIM. Our tool just provides an abstraction layer over the APIM REST APIs. We won't try to change their behavior.
Here's how to manually reproduce it:
Create an API without a web service URL.
Export the API's specification file.
The generated specification file will include the server's base URL.
Import the generated specification file.
Once the import is complete, the API has the base service URL as its web service URL.
I noticed this issue after promoting to our QA environment. The Dev url is showing up in QA because it comes from the openAPI spec which is added by Azure APIM. Fortunately it can be overridden using a publish configuration (see below), but this issue is annoying because the backend url was already provided via a backend and now it needs to be specified in two places that are under control of two different teams. Rather than deal with that I removed the backend and am just specifying the backend url via the following:
apis:
- name: my-api-name
properties:
serviceUrl: https://my-api-backend-url
why can't we use an empty string in the above sample? @waelkdouh / @nathan-j-nd
apis:
- name: my-api-name
properties:
serviceUrl: none, null, '' or ""
APIM Supports empty Web Service URL, manually you could remove it and save it, but when I am running the pipeline, it doesn't publish the changes, stating the error that the value for serviceUrl is invalid
@waelkdouh / @nathan-j-nd - any updates on this ticket?
Also interested in this.
@waelkdouh / @nathan-j-nd - any updates on this ticket?
Just to be clear this is an open source project. Do you are opening an issue and not a ticket and this we can't give you any timelines. We are currently busy with v6 release. We will get to this issue when we get time.
Will investigate. We might be reading serviceUrl: null
as serviceUrl: "null"
in configuration.
following
subscribing
@guythetechie Could this be because of JsonIgnore
?
[JsonPropertyName("serviceUrl")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string? ServiceUrl { get; init; }
Release version
APIOps v 3.0.1
Describe the bug
I have an API where Webservice URL is left empty and we are using 'set-backend-service' policy to add the backend dynamically. When we deploy the artifacts where apiInformation.json does not have 'serviceUrl' property, publisher is automatically using 'BaseUrl' value and adding it to 'Webservice Url' post deployment
Expected behavior
WebService url should be left empty
Actual behavior
Value from BaseUrl is assigned to Webservice url making both fields have the same value
Reproduction Steps