Skip to content

REST API frontend abstraction #69

@pastewka

Description

@pastewka

The code currently directly interacts with the REST API, in the sense that individual components issue GET, PUT etc. requests and consume the output.

This issue suggests refactoring part of this code to mirror backend ORM classes in the frontend.

Suggested steps:

  • Implement OpenAPI documentation for the backend, e.g. using django-spectacular
  • Generate automatic frontend classes, e.g. using openapi-ts
  • Switch code to use this abstraction layer

A key advantage of this is:

  • Checking the reponse against a schema (encoded in the frontend classes)
  • Easier testing because those classes can be mocked

Metadata

Metadata

Assignees

Labels

invalidThis doesn't seem right

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions