Fill in more example values for OpenAPI schema

This commit is contained in:
Tuan Dang
2023-01-16 10:13:56 +07:00
parent da251d3d2d
commit 2ae617cda6
5 changed files with 96 additions and 114 deletions

View File

@ -3582,39 +3582,39 @@
},
"email": {
"type": "string",
"example": ""
"example": "johndoe@gmail.com"
},
"firstName": {
"type": "string",
"example": ""
"example": "John"
},
"lastName": {
"type": "string",
"example": ""
"example": "Doe"
},
"publicKey": {
"type": "string",
"example": ""
"example": "johns_nacl_public_key"
},
"encryptedPrivateKey": {
"type": "string",
"example": ""
"example": "johns_enc_nacl_private_key"
},
"iv": {
"type": "string",
"example": ""
"example": "iv_of_enc_nacl_private_key"
},
"tag": {
"type": "string",
"example": ""
"example": "tag_of_enc_nacl_private_key"
},
"updatedAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
},
"createdAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
}
}
},
@ -3630,27 +3630,27 @@
},
"email": {
"type": "string",
"example": ""
"example": "johndoe@gmail.com"
},
"firstName": {
"type": "string",
"example": ""
"example": "John"
},
"lastName": {
"type": "string",
"example": ""
"example": "Doe"
},
"publicKey": {
"type": "string",
"example": ""
"example": "johns_nacl_public_key"
},
"updatedAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
},
"createdAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
}
}
},
@ -3676,27 +3676,27 @@
},
"email": {
"type": "string",
"example": ""
"example": "johndoe@gmail.com"
},
"firstName": {
"type": "string",
"example": ""
"example": "John"
},
"lastName": {
"type": "string",
"example": ""
"example": "Doe"
},
"publicKey": {
"type": "string",
"example": ""
"example": "johns_nacl_public_key"
},
"updatedAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
},
"createdAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
}
}
},
@ -3723,7 +3723,7 @@
},
"name": {
"type": "string",
"example": ""
"example": "Acme Corp."
},
"customerId": {
"type": "string",
@ -3776,7 +3776,7 @@
"properties": {
"publicKey": {
"type": "string",
"example": ""
"example": "senders_nacl_public_key"
}
}
},
@ -3938,11 +3938,11 @@
},
"updatedAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
},
"createdAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
}
}
},
@ -3962,15 +3962,15 @@
},
"email": {
"type": "string",
"example": ""
"example": "johndoe@gmail.com"
},
"firstName": {
"type": "string",
"example": ""
"example": "John"
},
"lastName": {
"type": "string",
"example": ""
"example": "Doe"
}
}
},
@ -4033,11 +4033,11 @@
},
"updatedAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
},
"createdAt": {
"type": "string",
"example": ""
"example": "2023-01-13T14:16:12.210Z"
}
}
},
@ -4087,7 +4087,7 @@
},
"type": {
"type": "string",
"example": ""
"example": "shared"
},
"user": {
"type": "string",
@ -4095,7 +4095,7 @@
},
"environment": {
"type": "string",
"example": ""
"example": "dev"
},
"isDeleted": {
"type": "string",

View File

@ -2,7 +2,6 @@
const swaggerAutogen = require('swagger-autogen')({ openapi: '3.0.0' });
const fs = require('fs').promises;
const yaml = require('js-yaml');
const { secretSchema } = require('./schemas/index.ts');
/**
* Generates OpenAPI specs for all Infisical API endpoints:
@ -43,25 +42,25 @@ const generateOpenAPISpec = async () => {
definitions: {
CurrentUser: {
_id: '',
email: '',
firstName: '',
lastName: '',
publicKey: '',
encryptedPrivateKey: '',
iv: '',
tag: '',
updatedAt: '',
createdAt: ''
email: 'johndoe@gmail.com',
firstName: 'John',
lastName: 'Doe',
publicKey: 'johns_nacl_public_key',
encryptedPrivateKey: 'johns_enc_nacl_private_key',
iv: 'iv_of_enc_nacl_private_key',
tag: 'tag_of_enc_nacl_private_key',
updatedAt: '2023-01-13T14:16:12.210Z',
createdAt: '2023-01-13T14:16:12.210Z'
},
Membership: {
user: {
_id: '',
email: '',
firstName: '',
lastName: '',
publicKey: '',
updatedAt: '',
createdAt: ''
email: 'johndoe@gmail.com',
firstName: 'John',
lastName: 'Doe',
publicKey: 'johns_nacl_public_key',
updatedAt: '2023-01-13T14:16:12.210Z',
createdAt: '2023-01-13T14:16:12.210Z'
},
workspace: '',
role: 'admin'
@ -69,12 +68,12 @@ const generateOpenAPISpec = async () => {
MembershipOrg: {
user: {
_id: '',
email: '',
firstName: '',
lastName: '',
publicKey: '',
updatedAt: '',
createdAt: ''
email: 'johndoe@gmail.com',
firstName: 'John',
lastName: 'Doe',
publicKey: 'johns_nacl_public_key',
updatedAt: '2023-01-13T14:16:12.210Z',
createdAt: '2023-01-13T14:16:12.210Z'
},
organization: '',
role: 'owner',
@ -82,7 +81,7 @@ const generateOpenAPISpec = async () => {
},
Organization: {
_id: '',
name: '',
name: 'Acme Corp.',
customerId: ''
},
Project: {
@ -97,7 +96,7 @@ const generateOpenAPISpec = async () => {
encryptedkey: '',
nonce: '',
sender: {
publicKey: ''
publicKey: 'senders_nacl_public_key'
},
receiver: '',
workspace: ''
@ -141,16 +140,16 @@ const generateOpenAPISpec = async () => {
secretCommentCiphertext: '',
secretCommentIV: '',
secretCommentTag: '',
updatedAt: '',
createdAt: ''
updatedAt: '2023-01-13T14:16:12.210Z',
createdAt: '2023-01-13T14:16:12.210Z'
},
Log: {
_id: '',
user: {
_id: '',
email: '',
firstName: '',
lastName: ''
email: 'johndoe@gmail.com',
firstName: 'John',
lastName: 'Doe'
},
workspace: '',
actionNames: [
@ -171,8 +170,8 @@ const generateOpenAPISpec = async () => {
],
channel: 'cli',
ipAddress: '192.168.0.1',
updatedAt: '',
createdAt: ''
updatedAt: '2023-01-13T14:16:12.210Z',
createdAt: '2023-01-13T14:16:12.210Z'
},
SecretSnapshot: {
workspace: '',
@ -188,9 +187,9 @@ const generateOpenAPISpec = async () => {
secret: '',
version: 1,
workspace: '',
type: '',
type: 'shared',
user: '',
environment: '',
environment: 'dev',
isDeleted: '',
secretKeyCiphertext: '',
secretKeyIV: '',

View File

@ -1,6 +0,0 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const secretSchema = require('./secretSchema.ts');
module.exports = {
secretSchema
}

View File

@ -1,11 +0,0 @@
const secretSchema = {
_id: {
type: 'string',
format: 'objectId'
},
version: {
type: 'number'
}
}
module.exports = secretSchema;

View File

@ -2208,31 +2208,31 @@ components:
example: ''
email:
type: string
example: ''
example: johndoe@gmail.com
firstName:
type: string
example: ''
example: John
lastName:
type: string
example: ''
example: Doe
publicKey:
type: string
example: ''
example: johns_nacl_public_key
encryptedPrivateKey:
type: string
example: ''
example: johns_enc_nacl_private_key
iv:
type: string
example: ''
example: iv_of_enc_nacl_private_key
tag:
type: string
example: ''
example: tag_of_enc_nacl_private_key
updatedAt:
type: string
example: ''
example: '2023-01-13T14:16:12.210Z'
createdAt:
type: string
example: ''
example: '2023-01-13T14:16:12.210Z'
Membership:
type: object
properties:
@ -2244,22 +2244,22 @@ components:
example: ''
email:
type: string
example: ''
example: johndoe@gmail.com
firstName:
type: string
example: ''
example: John
lastName:
type: string
example: ''
example: Doe
publicKey:
type: string
example: ''
example: johns_nacl_public_key
updatedAt:
type: string
example: ''
example: '2023-01-13T14:16:12.210Z'
createdAt:
type: string
example: ''
example: '2023-01-13T14:16:12.210Z'
workspace:
type: string
example: ''
@ -2277,22 +2277,22 @@ components:
example: ''
email:
type: string
example: ''
example: johndoe@gmail.com
firstName:
type: string
example: ''
example: John
lastName:
type: string
example: ''
example: Doe
publicKey:
type: string
example: ''
example: johns_nacl_public_key
updatedAt:
type: string
example: ''
example: '2023-01-13T14:16:12.210Z'
createdAt:
type: string
example: ''
example: '2023-01-13T14:16:12.210Z'
organization:
type: string
example: ''
@ -2310,7 +2310,7 @@ components:
example: ''
name:
type: string
example: ''
example: Acme Corp.
customerId:
type: string
example: ''
@ -2348,7 +2348,7 @@ components:
properties:
publicKey:
type: string
example: ''
example: senders_nacl_public_key
receiver:
type: string
example: ''
@ -2466,10 +2466,10 @@ components:
example: ''
updatedAt:
type: string
example: ''
example: '2023-01-13T14:16:12.210Z'
createdAt:
type: string
example: ''
example: '2023-01-13T14:16:12.210Z'
Log:
type: object
properties:
@ -2484,13 +2484,13 @@ components:
example: ''
email:
type: string
example: ''
example: johndoe@gmail.com
firstName:
type: string
example: ''
example: John
lastName:
type: string
example: ''
example: Doe
workspace:
type: string
example: ''
@ -2533,10 +2533,10 @@ components:
example: 192.168.0.1
updatedAt:
type: string
example: ''
example: '2023-01-13T14:16:12.210Z'
createdAt:
type: string
example: ''
example: '2023-01-13T14:16:12.210Z'
SecretSnapshot:
type: object
properties:
@ -2571,13 +2571,13 @@ components:
example: ''
type:
type: string
example: ''
example: shared
user:
type: string
example: ''
environment:
type: string
example: ''
example: dev
isDeleted:
type: string
example: ''