Skip to main content

Create an intermediate representation of an api schema, that can be used to generate code.

Project description

API schemas

Create an intermediate representation of an api schema, that can be used to generate code.

In other words: Same what OpenAPI has already but with fewer options.

But why?: Because it is fun 😎

Example API schema

typedef Example
    a: str
    b: int
    c: float
    d: any
    e: D {A, B, C}
    f: E
        Z = v v
        ?g[]: bool
        i: str
            type = Date
            format = yyyy-mm-dd HH:MM:ss.SSS
        j: $Week

typedef Date str
    type = Datetime
    format = yyyy-mm-dd HH:MM:ss.SSS
    
typedef Week {Monday, Tuesday, Wednesday}

typedef Q
    a: $Example
    b: $Date
    
typedef QQ $Q

server = http://localhost:5000/api/v1

people
    uri: /people/<name>
    GET
        ->
        <-
            200
                data: $Example
            404
                err_msg: str
            500
                err_msg: str
                
WS
    ->
        a
            i: str
            b: Name
                x: str
                i: int
        join_team
            num: str
    <-
        update
            i[]: int

Changelog

0.1.3

  • Add compilers to build dataclasses for python and dart
  • Add Websocket support
  • Allow Communications that are an array instead of an object

0.1.4

Date: 01.05.2020

  • Attribute body can be ReferenceType (#c9d8a896cd3653b36315cb31058e616d1296f988)
  • ReferenceType resolution after transform (#4f59f43861a0bccf65f20689d87b85962e0ad81e)
  • Basic error messages
  • Compiler: Add get_native_type method (#6ea36a7353847b064633908cb42cf6e449050e5a)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

api_schemas-0.1.4.tar.gz (9.8 kB view hashes)

Uploaded Source

Built Distribution

api_schemas-0.1.4-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page