ReST url path parameter naming conventions -



ReST url path parameter naming conventions -

are there naming conventions generic parameter names in rest url?

in illustration want address of section based on section id or organisation id under section coming under.

so url path parameter name deptororgid - valid based on naming conventions or should utilize generic name sectionid or officeid or represent both section id organisation id ?

thanks.

check section resource uri examples of naming convention tutorial. hope answer.

also, book defines 3 basic rules url design deed great starting point:

• utilize path variables encode hierarchy: /parent/child

• set punctuation characters in path variables avoid implying hierarchy none exists: /parent/child1;child2

• utilize query variables imply inputs algorithm, example: /search?q=jellyfish&start=20

other guidelines include:

• uris should ideally not alter on time.

• services offering uniquely identifiable resource via key should utilize basic rest notation (e.g. /accounts/(accountid) )

• services offering optional search/filtering capabilities should utilize query parameter ? key1 = value & key2 = value notation (e.g. /instruments?ticker=ft)

• services expecting mandatory arguments on should have them path variables (e.g. /accounthistory/(fromdate)/(todate)

• rest service names should utilize strict low case names (e.g. /client)

• elements of uri should map business entities , mapping should consistent. illustration business entity named contentpartner should consistently referred contentpartner(s) in uris (rather mix of partner, cp etc). starting point name of domain object.

• parameters not define resource qualify (e.g. locale feeds translations of data) should not form part of normal uri space. consider using headers or optional query parameters these

• utilize nouns, not verbs. powerfulness of rest comes through fact there limited verb set (operations) combined big set of nouns (or resources). consequently manner in these nouns constructed of great importance.

• avoid suffixes. when designinguris paramount refer thing beingness operated upon rather operation beingness performed. secondly, client interested in resource - not implementation of server software powers service. desirable avoid suffixes such .jsp or .aspx.

• utilize accepts header content negotiation

• maintain intuitive. uris should human readable or guessable. easiest way build uri hierarchy, grouping related items together. such patterns of category , subcategory easy understand.

rest

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -