Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

API Blueprint Evolving Where OpenAPI Spec Falls Short

DZone's Guide to

API Blueprint Evolving Where OpenAPI Spec Falls Short

API Blueprint is an API definition format, and it's shifting, causing an evolution in API design. Learn about body payload, and multiple media type support.

· Integration Zone
Free Resource

Learn how API management supports better integration in Achieving Enterprise Agility with Microservices and API Management, brought to you in partnership with 3scale

Z (@zdne) over at Apiary published a pretty interesting blog post before Christmas which highlights two important elements of profiling APIs using popular API definition formats. Z is key to the vision behind API Blueprint, one of the top 3 API definition formats, that are fueling API design in 2016. 

Giving the Body Some Love

One common complaint I've seen on forums, issue threads, and other places API developers hang out, is that OpenAPI Spec does not allow for properly describing the request body payload. I definitely agree with this but is something that doesn't often impact me, as the type of APIs I am currently deploying, rarely employ a very complex body payload. However, I do know some APIs that I've documented, where if you can't properly define the body, the API appears to have no value whatsoever, when described using an OpenAPI Spec.

It was good to hear Z state:

"In 2015, we have spent most of the year building only one feature--the description of body parameters. This feature is also know as the MSON syntax." - Z (@zdne)

Acknowledging Media Types

The next significant area Apiary is addressing with API Blueprint and MSON is when it comes to supporting multiple media types, and making sure they are properly described in the API definition--MSON

Z talks about how "MSON isn't another syntax for JSON. MSON is agnostic to serialization media types. With MSON, I can describe the data and defer the decision whether they will be sent as JSON, XML, or HAL over the wire."

I will be learning more MSON in January, and reacquainting myself with API Blueprint, as I document my APIs stack(s), but also specifically two of my APIs that provide JSON, HTML, and Siren media types. Hopefully, this will allow me to also document the growing number of hypermedia APIs available across the space.

Media types and body are two areas that OpenAPI Spec (aka Swagger) is deficient. Something that gives Apiary a pretty interesting head start when it comes to two pretty fundamental building blocks of the web, and, therefore, APIs. I was going to start using vendor extensions, to begin playing around with content-type negotiation in my OpenAPI Spec files, but I might just invest my energy into sharpening my API Blueprint skills, and definition repository instead.

Unleash the power of your APIs with future-proof API management - Create your account and start your free trial today, brought to you in partnership with 3scale.

Topics:
api ,swagger ,json ,html ,web design and web development ,open api

Published at DZone with permission of Kin Lane, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}