API Connect

 View Only
Expand all | Collapse all

Showing or Marking Deprecating APIs in Developer Portal

  • 1.  Showing or Marking Deprecating APIs in Developer Portal

    Posted Fri April 19, 2024 06:15 PM

    Hi 

    This is my vision and looking for some recommendations or suggestions.

    • Tagging Product as Active/Deprecated/Retired. So when User search the products  and Products lists are shown , when Products are shown as Cards , it also has some label showing  Active/Deprecated/Retired. And is there way to color code the Card that Green is active , yellow/orange is Deprecated and Red is retired.
    • And similar to Product, I am trying to show or tag these APIs as Deprecated/Retired.
    • And once those can be achieved and if these can also provide way to filter based on these Active/Deprecated/retired.
    • These I am looking for /product or /api pages.

    I know there will be questions asked like retired Product should not be there and that is correct but I am just trying to find a way to tag those.

    This could be purely Drupal question but wanted to see if anyone has tried this or any suggestions. 



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------


  • 2.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted Mon April 22, 2024 01:18 AM

    I'm not sure this makes sense to attempt.

    Retired products are removed from the portal as they are no longer used so there's no point tagging them with anything, they no longer exist. (This cannot be prevented, it's automatic)

    Deprecated products are only visible to someone who is already subscribed to it and inaccessible to everyone else (and are already labeled Deprecated pretty clearly).

    I think you might want to have a play around with the APIC lifecycle and the effect on the portal before wasting effort on this further. 

    Essentially every product an anonymous user can see is in "published" state.



    ------------------------------
    Chris Dudley
    ------------------------------



  • 3.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted Mon April 22, 2024 02:10 PM

    Yes , For Product Deprecating or retired , I get that. for existing user of the product I want to show that now this Product is deprecated.

    But For APIs list , yes I am looking for that functionality where APIs are tagged or similar way so that when user is checking the API list under product , these info are there for them.

    Or If I want to find deprecated/retired/Active some kind of search or View that I can create based on this data. 



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------



  • 4.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted Mon April 22, 2024 02:21 PM

    Deprecated products are already marked deprecated.

    An api isn't deprecated, the product it is in is deprecated.

    Retired ones don't even exist on the portal as they are deleted as soon as you retire the last product that contains that api.

    As I said, I think you need to experiment with what happens in the portal with different lifecycle states. Right now all apis will be a member of a published product or a handful might be in a product that is deprecated.

    Navigation is primarily around products not apis, the page is listing products not apis. 
    When looking at the apis within a product those apis all have the state of the parent product. You don't deprecate an api you deprecate the product that  obtains it. You can't retire an api, you retire the product that contains it.

    So if a product is deprecated and that's the only one you're subscribed to then all the apis are deprecated. If the product is published then so are all the apis in it. If the product is retired then it won't exist on the portal anymore, all subs will be deleted and any Apis only in that product will also be deleted.

    I dont think your scenario exists in APIC, simply APIs do not have state, products do.



    ------------------------------
    Chris Dudley
    ------------------------------



  • 5.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted Mon April 22, 2024 10:43 PM

    it totally depends upon how/when you version or deprecate your product.

    if active product has 2 APIS of v1 and v2 then for me v1 is deprecated but product is still Active so I want to show that API of v1 as marked as deprecated.

    And same way, when you are on /api page there I want to show active/deprecated.

    for the color code to Cards, I was able to color code it based on the tags coming from category of the product but I was not able to put the tags data to the Card itself , not sure what is missing.



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------



  • 6.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted Wed May 01, 2024 05:18 PM

    Basically my use case is I want to show the label Marked as Deprecated when consumers are searching.

    And I was able to get this functionality by editing the structure -->content Type -->Product and enable the state to the Card view and now it shows Deprecated on the card view

    but I am still struggling to show the label of API. Yes there is no functionality right now which says API to deprecated/Active/Retired etc so my thoughts are to use the value of "Tags" of the API Yaml and not the "Category".
    So we will set the tags of the API YAML as Deprecated etc.
    And when i checked the APIC drupal code , there is api_swaggertags where the tags are set for each API but I am not able to show this on the API  Page /api.
    I am not that good in Drupal which I am still kind of learning so any help is appriciated. 



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------



  • 7.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted Thu May 02, 2024 01:29 AM

    I understand what you want to do but it's not really correct.

    the api is not deprecated, the product it is in is deprecated not the api. Apis don't have state so I'm not sure how you expect to add labels to it to show an attribute it doesn't have.

    swaggertags are something entirely different and aren't going to help you here.

    There is no state field on an api that will show deprecated because Apis aren't deprecated so there is no label to show.

    Navigation in the portal is product first not api - you start on /products not /apis. If you switch that round in your portal then you do so at the cost of not being able to see the product specific attributes like lifecycle state. Can I suggest you revisit that decision? There is a reason none of our customers do it!



    ------------------------------
    Chris Dudley
    ------------------------------



  • 8.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted Thu May 02, 2024 06:14 PM

    Thank you Chris. I am completely on the same page as you.

    Currently we always have 1 Product version and all the APIs goes into that even multiple version of APIs.

    So right now I am researching all the possible ways and best which fits for our organization Product version policy.

    I have captured 2-3 ways of doing product versioning and one way is to maintain one Product as Deprecated which contains deprecated APIs and other product as Active which contains all latest APIs. 

    but this has issue  like if you end up versioning the APIs more frequent then you end up moving up quickly on the product version, with-in few months you end up on Version 10 of product which does not makes sense for the consumers. because you have to do lot of stuff like migrating the subscription etc.

    We don't do minor or patches of the APIs. Its always major version up which is another topic.

    So that's why I am trying to explore if there is a way to show a label that says this API is "Deprecated"

    Now yes I get that API does not have any state(deprecated/retired etc.) that's why I am trying to find ways and one way I thought of using the "tags" which currently we don't use for any purpose. So that we can tag the API as ACTIVE/DEPRECATED in YAML and this label is shown.



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------



  • 9.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted Fri May 03, 2024 01:17 AM

    I don't think that's a very good plan because you'd only be able to set the yaml tag by updating the api and republishing, it would also be entirely manual and easily forgotten.

    maybe look at adding a custom field to the api content type in the portal, then you can set the value whenever you like sepately from publishing new versions. The downside is the same - you'd need to do it separately from publishing the product.



    ------------------------------
    Chris Dudley
    ------------------------------



  • 10.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted 29 days ago

    could you please elaborate on this , i did not fully understand it. >> maybe look at adding a custom field to the api content type in the portal, then you can set the value whenever you like sepately from publishing new versions. 

    how and where I will set the value. Are you suggesting via admin tool and update this field to set "Deprecated" after deployment.



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------



  • 11.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted 27 days ago

    Yes I was able to do the steps and set the value and it does makes sense. but the only thing is that, this is manual step which is why I am trying to avoid and see if a way to use the 1st option.



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------



  • 12.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted 27 days ago

    You could use a custom module in the portal that uses the update drupal hook for a node of type product. Then every time a product is updated it could check if that product is deprecated, then loop over all the apis in that product and set that custom field you just added.

    That would remove the manual step and set the custom field based on the lifecycle state of the parent product. However this isn't going to work if the same API is in multiple products - which is precisely why we do not do anything like this out of the box.



    ------------------------------
    Chris Dudley
    ------------------------------



  • 13.  RE: Showing or Marking Deprecating APIs in Developer Portal

    Posted 27 days ago

    Thank you, but I am still not able show the label on the Product page.

    If I go to /api --- I was able to show the way you suggested

    But if I go to /Product and then click the Product to show all the APIs, then I don't see that label. because I am not sure where is embedded APIs are setup. Any suggestions.

    because there is 2 content type one is API and PRODUCT. But product does have the list of APIs now so not sure where I need to setup for this.



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------