To help with the responses and preventing yourself from having to manually check the possible values, you could generate the types based on the openapi document for the backend. Then use type hinting annotations to help. This will help with the maps between data and css classes as well as reduce any other potential bugs (like the values for browser implementation). You can use something like this to generate the typing based on the openapi.yaml: https://www.npmjs.com/package/openapi-typescript
From @jcscottiii :
Typing:
To help with the responses and preventing yourself from having to manually check the possible values, you could generate the types based on the openapi document for the backend. Then use type hinting annotations to help. This will help with the maps between data and css classes as well as reduce any other potential bugs (like the values for browser implementation). You can use something like this to generate the typing based on the openapi.yaml: https://www.npmjs.com/package/openapi-typescript