Chandan Kumar Roy
1 min readFeb 2, 2018

RESTful API design : Microservices — Continued .. Guideline /Documentation

General Guidelines for API

As such there is no industry standard, but below is the case preferred to use.

In case of property name

· Use camelCase and keep consistent across all API’s

· Array name should be plural

· Reserved keywords should be avoided

For property value

· Empty array should be represented by []

· Boolean properties must be null

· Null value should have their field

Naming

· URL contains long path url : Path segment must be lowercase and separated by hypens

e.g. /customer-details/{customer-id}

· Query parameter must be in lower case and separated by hypers in case of long

e.g. api/customer-details?customer-number=007&order-id=007

· Prefer Hyphenated-Pasacal-Case for HTTP header fields

· First path segment should be /api

· Avoid trailing slashes

· Use conventional Query string for limit(no of entries,offset (numeric pffset page start) ,and sort

· Always use pluralized resource name

Documenting API

In Restful API, It is very important to document the implementation .It make easy to understand and use . There are many tools available .Below is the list having few of them

· Swagger : https://swagger.io/ — Open source tool https://swagger.io/specification/

· Spring Rest Docs : http://docs.spring.io/spring-restdocs/docs/1.0.0.M1/reference/html5

· RAML: http://raml.org

· ApiDocJS : http://apidocjs.com

· SpringRestDoc : https://bitbucket.org/tritales/springrestdoc/overview

Happy learning …
If this post was helpful, please click the clap 👏button below a few times to show your support

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Written by Chandan Kumar Roy

Head of Software Engineering and Integration | MACH Alliance Ambassador

No responses yet

Write a response

Recommended from Medium

Lists

See more recommendations