0.1.5 • Published 4 years ago

openapi-typescript-sync v0.1.5

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
4 years ago

OpenApi synchronisation (openapi-ts-sync)

UNDER DEVELOPMENT

Description

This script will fetch a remote openapi.json and creates the schemas and a services to have a nice typescript support for schema properties and available remote endpoints.

Table Of Contents

Installation

$ npm install openapi-typescript-sync --save-dev

Todo

  • write tests
  • add header parameters as header parameters, now the authorization must be placed as a parameter, which does nothing and as AxiosRequestOptions.

Command

$ npm run bin/openapi-typescript-sync --schema-dir={{ schema-dir }} --route-dir={{ route-dir }}

Run with npm

Add the script to your package.json file:

{
  ...
  "scripts": {
     ...,
     "api-sync": "npm run bin/openapi-typescript-sync --config=./openapi-ts-sync.json",
     ...,
  },
  ...
}

Config

TODO: Document

Generators

TODO: Document

Custom Generator

A custom generator is simple a class implementing the interface GeneratorInterface.

import {GeneratorInterface} from './GeneratorInterface';

export class CustomGenerator implements GeneratorInterface{

	public generate(): Promise<void>{
	    return new Promise<void>((resolve, reject) => {
	    	// code to generate something
        });
    }
}
0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago