Skip to content

Conversation

@gin0115
Copy link
Collaborator

@gin0115 gin0115 commented Jun 13, 2025

Changes proposed in this Pull Request

  • Creates 2 endpoints
    • /license/{slug} > single license
    • /licenses/?name={name like}&keywords={cat serach}&stewards={steward term search}

calling /licenses will show all

I have also added a set of redirects, so we can access these using
https://opensoure.org/api/license/blue-oak-model-license/
or
https://opensoure.org/api/licenses?name=MIT

If we want to handle this from api.opensoure.org/licenses?name=MIT we can look at doing redirects from server level before WP/PHP kicks in.

Testing instructions

Calling https://opensource.gq/wp-json/osi/v1/licenses?name=MIT
image

https://opensource.gq/wp-json/osi/v1/licenses?steward=boost
image

https://opensource.gq/wp-json/osi/v1/licenses?keyword=international
image

Mentions #199

@gin0115 gin0115 merged commit c42376e into develop Jun 13, 2025
5 checks passed
@nickvidal
Copy link
Member

@gin0115 should https://opensource.org/api/licenses?name=MIT redirect to:

I believe the former, but it's redirecting to the latter.

@gin0115
Copy link
Collaborator Author

gin0115 commented Jun 17, 2025

Hmm thats odd, i will look into that, its working for others but some like MIT are causing issues

@nickvidal
Copy link
Member

Sorry for the double post, consolidating the issues here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants