TOSIT-IO / tdp-server

REST API for tdp-lib orchestration
2 stars 2 forks source link

95 implement schema validation #99

Closed gboutry closed 1 year ago

gboutry commented 1 year ago

Which issue(s) this PR fixes

Fixes #95

Additional comments

Agreements

PaulFarault commented 1 year ago

It seems to work well.

However, why did you choose to parametrize the endpoint for each serviceId? As we can GET the whole list of services and components variables from the /api/v1/services endpoint, we could expect to get the whole schema too.

gboutry commented 1 year ago

Because it makes sense to get a schema for a specific service,

I can add a /api/v1/service/schema endpoint to get all the schemas, if it's better for you ?

PaulFarault commented 1 year ago

That could be useful.

Though, if we can fetch both the whole schema and schema / service, wouldn't it make sense to fetch it at the component level too?

gboutry commented 1 year ago

After some discussion with @PaulFarault we came to the conclusion that having a different basepath for schemas was more appropriate. Force push is reflecting this change.

Now, 2 endpoinst, 1 to get all schemas, 1 to get specific service schema.

Though, if we can fetch both the whole schema and schema / service, wouldn't it make sense to fetch it at the component level too?

This does not make sense in the sense of how we defined schemas, but I agree that it looked weird before I separated the endpoints. I hope its clearer now.