java - Rest API - spring controllers and resources -


i writing rest api quite simple, first attempt , using spring framework.

the test app deals products, categories , types . product has type, category has many types , product can have multiple categories can fit wondering if should create spring controller each.

if did possible product when calling through category controller , o.k?

i mean this:

/categories/{category_id}/types/{type_id}/products 

to me filter category, type , products type, or not restful?

rest patterns should simple , not layered.

if wish retrieve things, should straightforward like:

/categories/{category_id} /products/{product_id} /types/{type_id} 

for filtering, should make use of query string instead of url path because url path cares order/hierarchy, whereas filtering should not concerned order.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -