LI3DS / api-li3ds

LI³DS Rest API
GNU General Public License v3.0
0 stars 3 forks source link

fixes #6 : POST platforms/id/config #7

Closed mbredif closed 7 years ago

mbredif commented 7 years ago

@ldgeo, is that the correct way to fix #6 ?

ldgeo commented 7 years ago

not really, it's more simple, i fixed it with 2de93b2

mbredif commented 7 years ago

Not sure, with your fix, the platform_id in the request uri (/platforms/<platform_id>/configs) is not used at all... The endpoint should not then be /configs rather than /platforms/<platform_id>/configs ?

ldgeo commented 7 years ago

you're right, i've touched the wrong parameter... but we don't need platform_id as it stands in the URL -> branch updated

mbredif commented 7 years ago

Now platform shows up in /platforms/configs/<config_id> but not in /platforms/<platform_id>/configs

The discrepancy comes from the marshalling in the latter case but not in the former

Do you want to shadow the platform as it is already passed by the user in the query or not ? My guess is you want to marshall in any case, and that you need to add the platform id to the model if you want to expose it.

ldgeo commented 7 years ago

no confusion for me, this is not the same endpoint, why do you need the platform id in /platforms/{id}/configs/ ? As you said, you have it in the request.

mbredif commented 7 years ago

Ok, I got it. you'd rather minimize communication (do not return the platform id if it was known as part of the query) rather than uniform return values for endpoints returning configs (/platforms/configs/<config_id> and /platforms/<platform_id>/configs). Thanks for explaining !