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

refactor(26237): Refactor the request infrastructure to the OpenAPI specs #566

Draft
wants to merge 16 commits into
base: epic/23777/bi-directional-frontend
Choose a base branch
from

Conversation

vanch3d
Copy link
Contributor

@vanch3d vanch3d commented Sep 18, 2024

See https://hivemq.kanbanize.com/ctrl_board/57/cards/26237/details/

This PR is part of the bi-directional epic and refactors the query infrastructure to abide to the OpenAPI specs proposed in #563

Design

The current implementation of the bi-directional features in the frontend is still based on a series of mocks (both data and process) to bypass the work-in-progress nature of the backend.

To drive the alignment of the two parts of the engineering process, a proposal was made for the expected API endpoints.

The PR refactors the bespoke mocks into a proper micro-service API mocking

  • The OpenAPI specs are used to generate the stubs for the services and models
  • All the expected endpoints are covered by their relevant React Query hooks
  • All the still-unsupported endpoints are covered by mocks, using MSW to intercept the requests and populate the returned body

Note that MSW needs to be activated for the mocks to be introduced. Change the following environment variable in the env.local files:

VITE_FLAG_MOCK_SERVER=true

@vanch3d vanch3d self-assigned this Sep 18, 2024
@cla-bot cla-bot bot added the cla-signed label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant