Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REST-compliance] Naming convention for APIs #1273

Closed
hdurix opened this issue Apr 8, 2022 · 6 comments · Fixed by #1289
Closed

[REST-compliance] Naming convention for APIs #1273

hdurix opened this issue Apr 8, 2022 · 6 comments · Fixed by #1289
Assignees
Labels
area: enhancement 🔧 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ generator: internal theme: api $100 https://www.jhipster.tech/bug-bounties/

Comments

@hdurix
Copy link
Member

hdurix commented Apr 8, 2022

Following #144

Try to have something like <collection>/<id>/<collection>/<id>/.../<element> (URL "leaf" can be either a collection, an id or an element):

  • /api/servers/spring-boot/databases/mysql is compliant
  • /api/svelte/styled is not compliant, could be renamed to something like /api/clients/svelte/style
  • /api/servers/spring-boot/mvc/web/springdoc/init-with-security-jwt is not compliant, could be renamed to something like /api/servers/spring-boot/api-documentations/springdoc/security-systems/jwt

This is to have a self explaining API and ready to add new options for each "tool" (ie: oauth2 security method instead of jwt).

before renaming an API, be sure to understand what it generates/does, that's the hard part :)

@hdurix
Copy link
Member Author

hdurix commented Apr 8, 2022

Below a summary of the changes I want to do:

Old URL New URL
/api/typescript /api/javascript-languages/typescript
/api/setup/codespaces /api/developer-tools/codespaces
/api/servers/spring-boot /api/servers/spring-boot
/api/servers/spring-boot/user/postgresql /api/servers/spring-boot/features/user/postgresql
/api/servers/spring-boot/user/mysql /api/servers/spring-boot/features/user/mysql
/api/servers/spring-boot/user/mariadb /api/servers/spring-boot/features/user/mariadb
/api/servers/spring-boot/spring-cloud/eureka-client /api/servers/spring-boot/distributed-systems/spring-cloud/eureka-client
/api/servers/spring-boot/spring-cloud/consul /api/servers/spring-boot/distributed-systems/spring-cloud/consul
/api/servers/spring-boot/spring-cloud/config-client /api/servers/spring-boot/distributed-systems/spring-cloud/config-client
/api/servers/spring-boot/mvc/web/undertow /api/servers/spring-boot/web-servers/undertow
/api/servers/spring-boot/mvc/web/tomcat /api/servers/spring-boot/web-servers/tomcat
/api/servers/spring-boot/mvc/web/actuator /api/servers/spring-boot/technical-tools/actuator
/api/servers/spring-boot/mvc/springdoc/init /api/servers/spring-boot/api-documentations/springdoc/init
/api/servers/spring-boot/mvc/springdoc/init-with-security-jwt /api/servers/spring-boot/api-documentations/springdoc/init-with-security-jwt
/api/servers/spring-boot/mvc/security/oauth2 /api/servers/spring-boot/security-systems/oauth2
/api/servers/spring-boot/mvc/security/oauth2/account /api/servers/spring-boot/security-systems/oauth2/account
/api/servers/spring-boot/mvc/security/jwt /api/servers/spring-boot/security-systems/jwt
/api/servers/spring-boot/mvc/security/jwt/basic-auth /api/servers/spring-boot/security-systems/jwt/basic-auth
/api/servers/spring-boot/mvc/dummy /api/servers/spring-boot/features/dummy
/api/servers/spring-boot/logging/logstash /api/servers/spring-boot/log-tools/logstash
/api/servers/spring-boot/logging/aop /api/servers/spring-boot/log-tools/aop
/api/servers/spring-boot/docker/jib /api/servers/spring-boot/containers/docker/jib
/api/servers/spring-boot/docker/dockerfile /api/servers/spring-boot/containers/docker/dockerfile
/api/servers/spring-boot/devtools /api/servers/spring-boot/technical-tools/devtools
/api/servers/spring-boot/databases/postgresql /api/servers/spring-boot/databases/postgresql
/api/servers/spring-boot/databases/mysql /api/servers/spring-boot/databases/mysql
/api/servers/spring-boot/databases/mongodb /api/servers/spring-boot/databases/mongodb
/api/servers/spring-boot/databases/migration/liquibase/user /api/servers/spring-boot/database-migration-tools/liquibase/user
/api/servers/spring-boot/databases/migration/liquibase/init /api/servers/spring-boot/database-migration-tools/liquibase
/api/servers/spring-boot/databases/migration/flyway/user /api/servers/spring-boot/database-migration-tools/flyway/user
/api/servers/spring-boot/databases/migration/flyway/init /api/servers/spring-boot/database-migration-tools/flyway
/api/servers/spring-boot/databases/mariadb /api/servers/spring-boot/databases/mariadb
/api/servers/spring-boot/cache/simple /api/servers/spring-boot/caches/simple
/api/servers/spring-boot/cache/ehcache/xml-configuration /api/servers/spring-boot/caches/ehcache/xml-configuration
/api/servers/spring-boot/cache/ehcache/java-configuration /api/servers/spring-boot/caches/ehcache/java-configuration
/api/servers/spring-boot/brokers/kafka /api/servers/spring-boot/brokers/kafka
/api/servers/spring-boot/brokers/kafka/dummy-producer /api/servers/spring-boot/brokers/kafka/dummy-producer
/api/servers/spring-boot/brokers/kafka/akhq /api/servers/spring-boot/brokers/kafka/akhq
/api/servers/spring-boot/banner/jhipster-v7 /api/servers/spring-boot/banners/jhipster-v7
/api/servers/spring-boot/banner/jhipster-v7-vue /api/servers/spring-boot/banners/jhipster-v7-vue
/api/servers/spring-boot/banner/jhipster-v7-react /api/servers/spring-boot/banners/jhipster-v7-react
/api/servers/spring-boot/banner/jhipster-v3 /api/servers/spring-boot/banners/jhipster-v3
/api/servers/spring-boot/banner/jhipster-v2 /api/servers/spring-boot/banners/jhipster-v2
/api/servers/spring-boot/banner/ippon /api/servers/spring-boot/banners/ippon
/api/servers/spring-boot/async /api/servers/spring-boot/async
/api/servers/sonar/java-backend /api/developer-tools/sonar/java-backend
/api/servers/sonar/java-backend-and-frontend /api/developer-tools/sonar/java-backend-and-frontend
/api/servers/java/jacoco-minimum-coverage /api/servers/java/jacoco-minimum-coverage
/api/servers/java/base /api/servers/java/base
/api/servers/java/arch /api/servers/java/arch
/api/projects/init /api/projects
/api/projects/download /api/project-downloads
/api/npm/prettier-format /api/package-managers/npm/prettier-format
/api/npm/install /api/package-managers/npm/install
/api/github-actions/maven /api/developer-tools/github-actions/maven
/api/frontend-maven-plugin /api/developer-tools/frontend-maven-plugin
/api/clients/vue /api/clients/vue
/api/clients/vue/styled /api/clients/vue/styles
/api/clients/vue/pinia /api/clients/vue/stores/pinia
/api/clients/svelte /api/clients/svelte
/api/clients/svelte/styled /api/clients/svelte/styles
/api/clients/react /api/clients/react
/api/clients/react/styled /api/clients/react/styles
/api/clients/react/cypress /api/clients/react/test-tools/cypress
/api/clients/angular /api/clients/angular
/api/clients/angular/styled /api/clients/angular/styles
/api/build-tools/maven /api/build-tools/maven
/api/build-tools/maven/wrapper /api/build-tools/maven/wrapper
/api/build-tools/maven/pom-xml /api/build-tools/maven/pom-xml
/api/projects/history /api/project-histories

Counter-proposals are more than welcome. All of them could also be renamed later on the same pattern.

I'm starting a PR to do all theses changes at once.

@pascalgrimaud
Copy link
Member

looks good !

@pascalgrimaud pascalgrimaud added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/ labels Apr 8, 2022
@fdelbrayelle
Copy link
Contributor

It seems OK for me as well :) Already compliant in brokers part 👍

@Bolo89
Copy link
Contributor

Bolo89 commented Apr 8, 2022

Hello,

For me all is good! I have only one remark; it's normal that the urls related to spring doc keep the verb " init " ?

/api/servers/spring-boot/api-documentations/springdoc/init
/api/servers/spring-boot/api-documentations/springdoc/init-with-security-jwt

@hdurix
Copy link
Member Author

hdurix commented Apr 8, 2022

Hello @Bolo89.
Indeed I didn't touch them as for me it will be covered by #1274: it's only different options that can be given as body to the web service. Only one POST /springdoc then.

@hdurix
Copy link
Member Author

hdurix commented Apr 8, 2022

We merged the PR as it was pretty impactful but don't hesitate to challenge naming, strategy, etc. This can be considered as a draft preceding many improvements :)

@hdurix hdurix self-assigned this Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: enhancement 🔧 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ generator: internal theme: api $100 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants