question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mandatory query parameters shown as template parameters when created from OpenAPI specification

See original GitHub issue

Bug description

Setting a required “Query” parameter in OpenAPI is getting set as “Template” parameter in Azure APIM.

Reproduction steps

  1. In the below OpenAPI sample, id has been marked as a required parameter in query : image
  2. On save of the OpenAPI spec, the mandatory query param is getting mapped to template param. image
  3. The main issue is that if the end user doesn’t provide an id in this above example, they would get a 404 resource not found without any additional info instead of a 400 Bad Request.

Expected behavior

Mandatory query parameters in OpenAPI spec should be created as mandatory query parameters and not template parameters. This behavior is happening if the api is created manually using the “Add operation” (without from OpenAPI spec).

Is your portal managed or self-hosted?

Managed

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
t-angelmancommented, Jan 26, 2022

@mikebudzynski

As far as I understood the bugfix should have been rolled out. But we still experience this issue in Azure Portal API Management. Please clarify if that bugfix really had effect on that issue.

image image

1reaction
mikebudzynskicommented, May 13, 2021

@Kumar-Ashwin-Hubert, the fix will be included in the next API Management service release in June and we expect it to fully roll out in July. You can monitor this GitHub site for the release notes: https://aka.ms/apim/releases Apologies for the confusion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Describing Parameters - Swagger
Query parameters can be primitive values, arrays and objects. OpenAPI 3.0 provides several ways to serialize objects and arrays in the query string....
Read more >
Mandatory query parameters shown as template type #636
Setting a required "Query" parameter in OpenAPI is getting set as "Template" parameter. Detailed Info: In the below OpenAPI sample, id has been ......
Read more >
APIM returning 404 when mandatory query parameter is not ...
It appears that when APIM imports an OpenAPI specification, it creates template parameters for any required query parameters (see ...
Read more >
How to add query paramters to API definition in OpenAPI ...
With this video we will learn How to add query paramters to API definition in OpenAPI specification 3.0 (OAS) ?
Read more >
Parameters and Payload of an Operation - GitHub Pages
OpenAPI provides two mechanisms to specify input data, parameters and request body (message payload). Parameters are typically used to identify a resource, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found