API-Portal icon indicating copy to clipboard operation
API-Portal copied to clipboard

How to add api specs by product

Open boyavenkatesh opened this issue 4 years ago • 11 comments

Hi There ,

we would like to categorize our apis by product . For this we are planning to define cards on home and provide a link to a product page for list of apis .

There is a api-specs folder , which is kind of generic for all pages . Is there a way to filter the list for defined page ( i.e product) .

Other issue we observed it , pages we added using admin module , can not be used as hyperlink to cards . It always says oops some thing went wrong .

Appreciate your help with this .

Cheers

boyavenkatesh avatar Jun 02 '21 00:06 boyavenkatesh

Hi @boyavenkatesh, just to clarify, do you want to have different API spec collections/folders to be shown on different pages depending on the page path?

Regarding the error, do you mind copy it from F12 console, just to be on the same page?

azaslonov avatar Jun 02 '21 00:06 azaslonov

correct . for example /product1-apis will show only the specs for product1 and /product2-apis should only show porduct2 apis .

Regarding the error :

anchorUtils.ts:22 Uncaught (in promise) Error: Parameter "pageContent" not specified. at Function.getHeadingNodes (anchorUtils.ts:22) at PageSelector.eval (pageSelector.ts:125) at Generator.next () at fulfilled (pageSelector.ts:14)

boyavenkatesh avatar Jun 02 '21 00:06 boyavenkatesh

Got it. So short answer - not out of the box. This will require some change into this operation.

Regarding the bug, looks like we fixed it in upstream libraries, so we'll merge it soon and check that issue.

azaslonov avatar Jun 02 '21 01:06 azaslonov

Got it . Will it be considered as future enhancement .

Cool, will wait for merge .

boyavenkatesh avatar Jun 02 '21 01:06 boyavenkatesh

Can't promise, it looks very case-specific, but let's track it as an enhancement at least.

azaslonov avatar Jun 02 '21 01:06 azaslonov

@boyavenkatesh, a potentially better way would be to tag APIs and then create links to the API list with a preset tag filter. Although the API list already supports passing tag filters as URL parameters, the API Portal doesn't support tags from the OpenAPI files.

mikebudzynski avatar Jun 03 '21 18:06 mikebudzynski

@mikebudzynski , we are looking to use Tags from Open API files , not via URL parameters . Unfortunately , API portal does not support tags from OpenAPI files as you noted.

boyavenkatesh avatar Jun 03 '21 21:06 boyavenkatesh

@boyavenkatesh, I meant that the API list widget already supports applying the tag filters from the URL parameters. For example, https://contoso.com/apis#tags=testtag could automatically filter the list of APIs by the testtag tag. With this feature, you could create links to your offerings, by categorizing the APIs with tags.

Currently, the missing part is the lack of support for tags from OpenAPI files in the API Portal. For comparison, in Azure API Management's developer portal, which uses a similar widget, the tags are fetched from the API Management service and this end-to-end solution is already possible.

mikebudzynski avatar Jun 03 '21 22:06 mikebudzynski

@mikebudzynski got that . We are not keen to add tags as URL filter all existing APIs . Instead all put API definitions have tag element, which makes sense to use them rather adding this URL paramter.

boyavenkatesh avatar Jun 04 '21 04:06 boyavenkatesh

@boyavenkatesh, I meant that the API list widget already supports applying the tag filters from the URL parameters. For example, https://contoso.com/apis#tags=testtag could automatically filter the list of APIs by the testtag tag. With this feature, you could create links to your offerings, by categorizing the APIs with tags.

Currently, the missing part is the lack of support for tags from OpenAPI files in the API Portal. For comparison, in Azure API Management's developer portal, which uses a similar widget, the tags are fetched from the API Management service and this end-to-end solution is already possible.

@mikebudzynski as per your comment https://contoso.com/apis#tags=testtag . Do you mean to have an URL parameter called tags for every api definition in Open API file ? Or is it some thing done in Portal configuration

boyavenkatesh avatar Jun 15 '21 00:06 boyavenkatesh

@mikebudzynski as per your comment https://contoso.com/apis#tags=testtag . Do you mean to have an URL parameter called tags for every api definition in Open API file ? Or is it some thing done in Portal configuration

You can assign tags to APIs in the Azure portal - it can be one tag per API or a set of tags per API. Those tags are then surfaced in the developer portal.

mikebudzynski avatar Jun 17 '21 17:06 mikebudzynski