Typescript types, JSON schemas and swagger configuration files of Glider projects: Derbysoft Proxy, ...
yarn add @windingtree/glider-types
const fs = require('fs');
const path = require('path');
// Importing the swagger doc
const doc = fs.readFileSync(
path.resolve('node_modules', '@windingtree/glider-types/dist/derbysoft_proxy.yaml'),
'utf8'
);
import { derbysoft_proxy } from '@windingtree/glider-types';
// derbysoft_proxy.definitions.Price
// ...
// ...
import type { Price } from '@windingtree/glider-types/dist/derbysoft_proxy';
All schema definitions are collected in the commonly shared file located at ./src/shared-definitions.yaml
.
Project-specific swagger configuration files are located in the named files like ./src/derbysoft-proxy.yaml
.
Project-specific swagger configuration files should not contain any data type definitions. Instead of that, all links to the definitions must be organized using schema references like $ref: "#components/schemas/DefinitionKey"
.
During the module build, all definitions that have been referred to will be built in the final swagger file of every specific project.
Every definition must follow these mandatory rules:
- Must have unique CamelCase styled key
- Must have description
- Must have definition of properties types
- Must have definition of required properties
- Must have an example of usage
If it is required, a definition can have format validation rules in regular expressions format or native rules supported by swagger.
- The accommodations API
- Simard Pay API
- Win-backend API
To add new project:
- Add project configuration to the
./scripts/build.js
to thesupportedApis
constant at line 11 in format:
{
name: 'project-name', // Unique project name
path: 'src/project-name.yaml' // Base project swagger file
}
- Create a swagger file by the pointed path
Please check the CONTRIBUTING.md