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

[Epic] 3.4: Self-documenting Rest APIs #23

Open
3 tasks
mfw78 opened this issue Oct 19, 2023 · 1 comment
Open
3 tasks

[Epic] 3.4: Self-documenting Rest APIs #23

mfw78 opened this issue Oct 19, 2023 · 1 comment
Labels
E:3.4 Self-documenting Rest APIs See https://github.com/cowprotocol/pm/issues/23 for details epic Tracks a yearly team epic (only for cowprotocol/pm repo)

Comments

@mfw78
Copy link
Contributor

mfw78 commented Oct 19, 2023

Epic label: E:3.4 Self-documenting Rest APIs
Planned start date: 01/12/2023
Due date: 31/12/2023

Summary

Within the services repository, there are two Rest APIs that are exported in openapi.yml, notably in the orderbook and the solvers crates.

When analysing these Rest APIs, it was identified that:

  1. The openapi.yml that is used by downstream consumers is not programmatically bound / generated via CI/CD, leading to error-prone manual maintenance / updating.
  2. The solvers crate makes use of axum / tower, as opposed to the orderbook crate that makes use of warp.

Acceptance Criteria

On completion of this refactor, the Rest APIs shall:

  1. Absent a compelling argument against, use the same dependency for running the Rest API.
  2. Have their OpenAPI specification programmatically generated.
  3. Have their generated OpenAPI specification thoroughly tested against the respective service for completeness / accuracy.

Tasks

  • research: axum vs warp (unify, or not?)
  • research: suitability of utoipa for openapi generation
  • research: api property testing with schemathesis
@mfw78 mfw78 added the epic Tracks a yearly team epic (only for cowprotocol/pm repo) label Oct 19, 2023
@mfw78 mfw78 added this to the Complexity Reduction milestone Oct 19, 2023
@mfw78 mfw78 added the E:3.4 Self-documenting Rest APIs See https://github.com/cowprotocol/pm/issues/23 for details label Oct 19, 2023
@squadgazzz
Copy link

We can consider using utoipa, but this project(https://github.com/ProbablyClem/utoipauto) clearly describes the main drawback of the lib's current state. But looks like this project is not currently ready to work with external types: ProbablyClem/utoipauto#4 meaning that schemas should be specified manually, which is also prone to human errors.

@mfw78 mfw78 changed the title [Epic] 3.4 Self-documenting Rest APIs [Epic] 3.4: Self-documenting Rest APIs Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:3.4 Self-documenting Rest APIs See https://github.com/cowprotocol/pm/issues/23 for details epic Tracks a yearly team epic (only for cowprotocol/pm repo)
Projects
None yet
Development

No branches or pull requests

2 participants