Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Latest commit

 

History

History
27 lines (21 loc) · 1.54 KB

README.md

File metadata and controls

27 lines (21 loc) · 1.54 KB

Resource Model

Description: This project can be used to create openapi 3.0 specification from a simple resource schema. Checkout the examples for sample resource schemas.

Lifecycle Archived

How to create an openapi spec

create a base directory for your schema. cd $basedirectory create an apischemas directory in your base directory which will store both your resource schema and openapispec. mdkir apischemas cd apischemas you can write your resource schema in rschemas directory mkdir rschemas set a group name by export family='GROUP_NAME' Run the openapi_converter script. In the below example resource1 and resource2 are the name of your resource schema files. openapi_converter -b $basedirectory -l resource1,resource2 you can see the openapispec generated under $basedirectory/apischemas/openapi

Additional tips

Resources are modeled using jsonschema. We currently support jsonschema draft 4. It is written in yaml format. Every resource must be of type object. Based on the schema of resource, spec for CRUD will be autogenerated. If you dont want to support CRUD, you can define rpc only. Checkout various examples for more details.

Jsonschema support $ref keyword for reusing custom definitions. We support internal definitions, file and http references to resolve schema in the resource schema files. All schema files which are referenced in the resource schema file should be under common directory inside rschemas directory ($basedirectory/apischemas/rschemas/common) written in yaml format.