<commit_before>---
layout: post
title: Open API layer
categories:
  - software-development
date: 2018-02-07
---

OpenAPI is the last version of Swagger RESTful API contractualization: an easy and efficient way to contractualize and share your API to other guys.

## `chpr-openapi`

A useful Node.js library, `chpr-openapi` [^1] is allowing you to add Open API specification to your Express API without having your code interweaved with external tool.

The specification is defined along your controllers and bound to your app like any other middleware. You can define the specification in the better way you decide by just creating a full JS Object validating the Open API 3.0 specification.

A secure web version of the documentation is available thanks to the amazing module ReDoc [^2]. One of the most important objective of Open API is to contractualize 

--------------------------------------

[^1]: [chpr-openapi - https://www.npmjs.com/package/chpr-openapi](https://www.npmjs.com/package/chpr-openapi)

[^2]: [redoc - https://github.com/Rebilly/ReDoc](https://github.com/Rebilly/ReDoc)
<!--stackedit_data:
eyJoaXN0b3J5IjpbMTUzNTUxOTU3MF19
--><commit_msg>Uploaded by https://stackedit.io/<commit_after>---
layout: post
title: Open API layer
categories:
  - software-development
date: 2018-02-07
---

OpenAPI is the last version of Swagger RESTful API contractualization: an easy and efficient way to contractualize and share your API to other guys.

## `chpr-openapi`

A useful Node.js library, `chpr-openapi` [^1] is allowing you to add Open API specification to your Express API without having your code interweaved with external tool.

The specification is defined along your controllers and bound to your app like any other middleware. You can define the specification in the better way you decide by just creating a full JS Object validating the Open API 3.0 specification.

A secure web version of the documentation is available thanks to the amazing module ReDoc [^2]. One of the most important objective of Open API is to strictly contractualize RESTFul API and share their specifications to others. The key feature of Open API and ReDoc is to always share the most up-to-date definition of your API contract.

Forget discrepancies  

--------------------------------------

[^1]: [chpr-openapi - https://www.npmjs.com/package/chpr-openapi](https://www.npmjs.com/package/chpr-openapi)

[^2]: [redoc - https://github.com/Rebilly/ReDoc](https://github.com/Rebilly/ReDoc)
<!--stackedit_data:
eyJoaXN0b3J5IjpbMzUwNTczODYyXX0=
-->
{'fraction_non_alphanumeric': 0.10866141732283464, 'fraction_numerical': 0.014960629921259842, 'mean_word_length': 3.7943396226415094, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 9, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1973297', 'n_tokens_mistral': 749, 'n_tokens_neox': 694, 'n_words': 309}