Giter Site home page Giter Site logo

resource-model's Introduction

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.

Build Status

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.

resource-model's People

Contributors

ceache avatar lisajoseph avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.