You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
API Elements is a uniform interface for dealing
with API description formats (API Blueprint, OpenAPI, ...). This repository contains tooling for handling API
Elements in JavaScript along with parsers and serializers for API description
languages. @apielements/cli provides a command line interface to
API Elements which can be used to validate API Description Documents.
const{ Fury }=require('@apielements/core');constfury=newFury();// Load any parsers or serializer adapters you wish to useconstapiBlueprintParser=require('@apielements/apib-parser');fury.use(apiBlueprintParser);constopenAPI2Parser=require('@apielements/openapi2-parser');fury.use(openAPI2Parser);constsource=`FORMAT: 1A# My API## GET /message+ Response 200 (text/plain) Hello World!`;fury.parse({source},(error,parseResult)=>{console.log(parseResult.api.title);});
See API Reference documentation
for the details about the ParseResult object and other elements interface in
JavaScript.
API Elements
Reference contains
information regarding the design of various API Elements.
Development
Using Lerna
Install dependencies of all packages:
$ npm install --global yarn
$ yarn
NOTE: Please do commit the yarn.lock to the GitHub repo
$ npx lerna exec --scope='package_name' -- npm run test
Documentation
The documentation is built using Sphinx, a Python tool. Assuming you have
Python 3 and
pipenv
installed, the following steps can be used to build the site.
$ cd docs
$ pipenv install --dev
Running the Development Server
You can run a local development server to preview changes using the following: