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

openapi design. client-server mode. let controller to implement interface #3942

Closed
Anilople opened this issue Sep 2, 2021 · 0 comments · Fixed by #3943
Closed

openapi design. client-server mode. let controller to implement interface #3942

Anilople opened this issue Sep 2, 2021 · 0 comments · Fixed by #3943
Labels
area/openapi apollo-openapi discussion Categorizes issue as related to discussion enhancement

Comments

@Anilople
Copy link
Contributor

Anilople commented Sep 2, 2021

Is your feature request related to a problem? Please describe.

If someone want to find which controller in portal implement the method com.ctrip.framework.apollo.openapi.client.ApolloOpenApiClient#createCluster, it will take some effort.

How about add some interface to make it more easier?

For example:

  • interface ApolloXXXOpenApi: in module apollo-openapi, user can use it directly.
  • class ApolloXXXOpenApiClient: in module apollo-openapi, the client's implementation of ApolloXXXOpenApi, user cannot access it.
  • class ApolloXXXOpenApiController: in module apollo-portal, the server's implementation of ApolloXXXOpenApi

Use this pattern, we can add more openapi faster than before?

Describe the solution you'd like
Keep the compability, add interfaces to module apollo-openapi, let controllers in module apollo-portal implement them.

Describe alternatives you've considered
It is ok to use spring-web in module apollo-openapi? We can maintain the url information in ApolloXXXOpenApi

public interface ApolloNamespaceOpenApi {
  @GetMapping(value = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces")
  List<OpenNamespaceDTO> findNamespaces(String appId, String env, String clusterName);
}

Then the client and server can use this information, the user also can view it directly.

Drawback: apollo-openapi is a lower level than user's code, so apollo-openapi cannot use spring cause it maybe conflict with user's code

@Anilople Anilople added enhancement area/openapi apollo-openapi discussion Categorizes issue as related to discussion labels Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/openapi apollo-openapi discussion Categorizes issue as related to discussion enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant