Skip to content

martinstreicher/apiary_style_guides

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apiary_style_guides

This code provides a test jig for the development and testing of new Apiary Style Guide rules. Given a set of rules and a Blueprint API specification, the code iterates over specific constructs in the specification, validating each occurrence of a construct against applicable rules.

For example, a URL is a construct, as is the format of JSON keys. One rule might dictate every URL that receives a POST must end as plural. Another rule could mandate that JSON keys match the format [[:lower:]][[:alnum:]]* (any string beginning with a lower case letter, followed by any number of characters from the set 0-9a-zA-Z).

Each occurrence of a construct is sent to one or more validation methods. If the occurrence is valid, the method returns true; otherwise, the method yields false.

A small manifest written in JSON maps constructs to validation methods. You can find an example manifest in this repo at apiary/rules.json. The combination of the manifest and a set of validation rules is an enforceable style guide. If you're using the Apiary Interactive Editor, non-conforming elements are immediately flagged as an issue. Some heinous errors may even prevent saving and committing changes to the spec.

Style Guide

What makes an API Compliant

References

Apiary Style Guides

Enhancing Apiary Workflow

The Open Source API Blueprint Description Language

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published