Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

How to add api specs by product #22

Open
boyavenkatesh opened this issue Jun 2, 2021 · 11 comments
Open

How to add api specs by product #22

boyavenkatesh opened this issue Jun 2, 2021 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@boyavenkatesh
Copy link

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

@azaslonov
Copy link
Member

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 azaslonov self-assigned this Jun 2, 2021
@azaslonov azaslonov added the question Further information is requested label Jun 2, 2021
@boyavenkatesh
Copy link
Author

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)

@azaslonov
Copy link
Member

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.

@boyavenkatesh
Copy link
Author

Got it . Will it be considered as future enhancement .

Cool, will wait for merge .

@azaslonov
Copy link
Member

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

@azaslonov azaslonov added enhancement New feature or request and removed question Further information is requested labels Jun 2, 2021
@mikebudzynski
Copy link
Contributor

@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.

@boyavenkatesh
Copy link
Author

@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.

@mikebudzynski
Copy link
Contributor

@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.

@boyavenkatesh
Copy link
Author

@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
Copy link
Author

@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

@mikebudzynski
Copy link
Contributor

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants