Real-Dev-Squad / feature-flag-service

MIT License
3 stars 7 forks source link

[DRAFT] Create API contracts #95

Open vikhyat187 opened 1 year ago

vikhyat187 commented 1 year ago

Contracts

Data model #96

Routes

Create a feature flag:

POST {{base_url}}/feature-flags/

Get feature flag

GET {{base_url}}/feature-flags/:flagId

Edit feature flag

PUT {{base_url}}/feature-flags/?flagId=flagId

Delete feature flag (should we soft delete(add a deletedAt column or remove the entry from db)

DELETE {{base_url}}/feature-flags/?flagId=flagId

Check if the feature flag is enabled for user Id: (will update as per data model)

Given a user fetch all features enabled. (Need to update on deciding the approach for model)

Enable feature flag for User Id: (this will decide after finalising data model)

gauravv-dev commented 1 year ago

Some thoughts

vikhyat187 commented 1 year ago

Don't think we need "message" in the response payload for success. If we want to keep it just an "ok" would be sufficient. In case of errors, it is definitely important and should be concise and helpful for the client combined with appropriate error messages. Created HTTP code is 201.

Noted, will use that

Instead of documenting the contracts here I would strongly suggest using Open API specification. There's good tooling around it so you could do a lot with that.

will try this out