Add basically API documentation

This commit is contained in:
Jonas Lochmann 2020-05-04 02:00:00 +02:00
parent ab16134a8e
commit d021497e52
No known key found for this signature in database
GPG key ID: 8B8C9AEE10FA5B36
149 changed files with 7811 additions and 39 deletions

View file

@ -45,6 +45,15 @@ const types = [
'SignInByMailCodeRequest'
]
const docOnlyTypes = [
'ServerDataStatus'
]
const allTypes = [
...types,
...docOnlyTypes
]
const settings = {
required: true,
noExtraProps: true
@ -66,7 +75,7 @@ let definitions = {}
let schemas = {}
let output = ''
types.forEach((type) => {
allTypes.forEach((type) => {
const schema = generator.getSchemaForSymbol(type)
schemas[type] = schema
@ -108,6 +117,10 @@ types.forEach((type) => {
const functionName = 'is' + type.substr(0, 1).toUpperCase() + type.substr(1)
output += 'export const ' + functionName + ': (value: object) => value is ' + type + ' = ' + functionBody + '\n'
})
allTypes.forEach((type) => {
const schema = schemas[type]
const schemaToSave = {
...addDefinitionTitles(removeUnusedDefinitions(schema)),