Closed benoitblanc closed 1 year ago
You will have to update the api.yaml because there is no id in the response of this route. But it could be interesting to have the same object for this route and the /services route. What do you think ?
@lgrd There is no id
in serviceConfiguration
response in api.yml for now, I have to add it to have the correct response for /services
route. Also, I started to implement this new route with the same object so /services/:service
will also have an id
.
Does it look good for you ?
Oh ! I got the point...
Now, you have this in the yaml :
200:
description: "successful operation"
content:
application/json:
schema:
type: "array"
items:
type: "object"
allOf:
- type: "object"
properties:
id:
type: "string"
- $ref: "#/components/schemas/serviceConfiguration"
This is because, when you POST or PATCH a service, you will not give the id inside the body. It is only inside the URL parameter.
That's why I add it only in the response of /services. So, to be in line with the other /service/{serviceId}, let us keep the api.yaml like it is.
So, in your code section, you can only read the content of service.json and return it. You don't have to add the id.
Is that ok for you ?
Sorry I did not see that id
was added outside serviceConfiguration
in /services
. So yes I will update my branch to only return serviceConfiguration
without id
.
thanks ! I will test your code tomorrow but it looks good ! ;)
Create GET
/services/:service
like it is specified inside https://github.com/IGNF/road2/blob/develop/documentation/apis/administration/1.0.0/api.yaml.Code
getServicesConfigurations()
to use the newgetServiceConfiguration()
to get configuration for each service