Skip to content

Commit

Permalink
Fill in more example values for OpenAPI schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dangtony98 committed Jan 16, 2023
1 parent da251d3 commit 2ae617c
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 114 deletions.
64 changes: 32 additions & 32 deletions backend/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3582,39 +3582,39 @@
},
"email": {
"type": "string",
"example": ""
"example": "[email protected]"
},
"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"
}
}
},
Expand All @@ -3630,27 +3630,27 @@
},
"email": {
"type": "string",
"example": ""
"example": "[email protected]"
},
"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"
}
}
},
Expand All @@ -3676,27 +3676,27 @@
},
"email": {
"type": "string",
"example": ""
"example": "[email protected]"
},
"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"
}
}
},
Expand All @@ -3723,7 +3723,7 @@
},
"name": {
"type": "string",
"example": ""
"example": "Acme Corp."
},
"customerId": {
"type": "string",
Expand Down Expand Up @@ -3776,7 +3776,7 @@
"properties": {
"publicKey": {
"type": "string",
"example": ""
"example": "senders_nacl_public_key"
}
}
},
Expand Down Expand Up @@ -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"
}
}
},
Expand All @@ -3962,15 +3962,15 @@
},
"email": {
"type": "string",
"example": ""
"example": "[email protected]"
},
"firstName": {
"type": "string",
"example": ""
"example": "John"
},
"lastName": {
"type": "string",
"example": ""
"example": "Doe"
}
}
},
Expand Down Expand Up @@ -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"
}
}
},
Expand Down Expand Up @@ -4087,15 +4087,15 @@
},
"type": {
"type": "string",
"example": ""
"example": "shared"
},
"user": {
"type": "string",
"example": ""
},
"environment": {
"type": "string",
"example": ""
"example": "dev"
},
"isDeleted": {
"type": "string",
Expand Down
65 changes: 32 additions & 33 deletions backend/swagger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -43,46 +42,46 @@ const generateOpenAPISpec = async () => {
definitions: {
CurrentUser: {
_id: '',
email: '',
firstName: '',
lastName: '',
publicKey: '',
encryptedPrivateKey: '',
iv: '',
tag: '',
updatedAt: '',
createdAt: ''
email: '[email protected]',
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: '[email protected]',
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'
},
MembershipOrg: {
user: {
_id: '',
email: '',
firstName: '',
lastName: '',
publicKey: '',
updatedAt: '',
createdAt: ''
email: '[email protected]',
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',
status: 'accepted'
},
Organization: {
_id: '',
name: '',
name: 'Acme Corp.',
customerId: ''
},
Project: {
Expand All @@ -97,7 +96,7 @@ const generateOpenAPISpec = async () => {
encryptedkey: '',
nonce: '',
sender: {
publicKey: ''
publicKey: 'senders_nacl_public_key'
},
receiver: '',
workspace: ''
Expand Down Expand Up @@ -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: '[email protected]',
firstName: 'John',
lastName: 'Doe'
},
workspace: '',
actionNames: [
Expand All @@ -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: '',
Expand All @@ -188,9 +187,9 @@ const generateOpenAPISpec = async () => {
secret: '',
version: 1,
workspace: '',
type: '',
type: 'shared',
user: '',
environment: '',
environment: 'dev',
isDeleted: '',
secretKeyCiphertext: '',
secretKeyIV: '',
Expand Down
6 changes: 0 additions & 6 deletions backend/swagger/schemas/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions backend/swagger/schemas/secretSchema.ts

This file was deleted.

Loading

0 comments on commit 2ae617c

Please sign in to comment.