mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-15 01:16:22 +02:00
OpenAPI: clean up remaining schemas, part 1 (#4351)
Part of linear task 1-1167. Fixes the first slew of schemas missing descriptions/examples, etc.
This commit is contained in:
parent
fc54877473
commit
12209ae21c
@ -90,7 +90,6 @@ const metaRules: Rule[] = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
knownExceptions: [
|
knownExceptions: [
|
||||||
'createInvitedUserSchema',
|
|
||||||
'featureStrategySegmentSchema',
|
'featureStrategySegmentSchema',
|
||||||
'maintenanceSchema',
|
'maintenanceSchema',
|
||||||
'toggleMaintenanceSchema',
|
'toggleMaintenanceSchema',
|
||||||
@ -118,12 +117,6 @@ const metaRules: Rule[] = [
|
|||||||
required: ['description'],
|
required: ['description'],
|
||||||
},
|
},
|
||||||
knownExceptions: [
|
knownExceptions: [
|
||||||
'adminFeaturesQuerySchema',
|
|
||||||
'applicationSchema',
|
|
||||||
'applicationsSchema',
|
|
||||||
'createFeatureSchema',
|
|
||||||
'createInvitedUserSchema',
|
|
||||||
'dateSchema',
|
|
||||||
'featureStrategySegmentSchema',
|
'featureStrategySegmentSchema',
|
||||||
'maintenanceSchema',
|
'maintenanceSchema',
|
||||||
'toggleMaintenanceSchema',
|
'toggleMaintenanceSchema',
|
||||||
|
@ -4,6 +4,8 @@ export const adminFeaturesQuerySchema = {
|
|||||||
$id: '#/components/schemas/adminFeaturesQuerySchema',
|
$id: '#/components/schemas/adminFeaturesQuerySchema',
|
||||||
type: 'object',
|
type: 'object',
|
||||||
additionalProperties: false,
|
additionalProperties: false,
|
||||||
|
description:
|
||||||
|
'Query parameters used to modify the list of features returned.',
|
||||||
properties: {
|
properties: {
|
||||||
tag: {
|
tag: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
@ -3,6 +3,8 @@ import { FromSchema } from 'json-schema-to-ts';
|
|||||||
export const applicationSchema = {
|
export const applicationSchema = {
|
||||||
$id: '#/components/schemas/applicationSchema',
|
$id: '#/components/schemas/applicationSchema',
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
description:
|
||||||
|
"Data about an application that's connected to Unleash via an SDK.",
|
||||||
additionalProperties: false,
|
additionalProperties: false,
|
||||||
required: ['appName'],
|
required: ['appName'],
|
||||||
properties: {
|
properties: {
|
||||||
|
@ -4,11 +4,13 @@ import { FromSchema } from 'json-schema-to-ts';
|
|||||||
export const applicationsSchema = {
|
export const applicationsSchema = {
|
||||||
$id: '#/components/schemas/applicationsSchema',
|
$id: '#/components/schemas/applicationsSchema',
|
||||||
additionalProperties: false,
|
additionalProperties: false,
|
||||||
|
description:
|
||||||
|
'An object containing a list of applications that have connected to Unleash via an SDK.',
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
applications: {
|
applications: {
|
||||||
description:
|
description:
|
||||||
'Contains a list of applications that have connected via an SDK',
|
'The list of applications that have connected to this Unleash instance.',
|
||||||
type: 'array',
|
type: 'array',
|
||||||
items: {
|
items: {
|
||||||
$ref: '#/components/schemas/applicationSchema',
|
$ref: '#/components/schemas/applicationSchema',
|
||||||
|
@ -3,6 +3,7 @@ import { FromSchema } from 'json-schema-to-ts';
|
|||||||
export const createFeatureSchema = {
|
export const createFeatureSchema = {
|
||||||
$id: '#/components/schemas/createFeatureSchema',
|
$id: '#/components/schemas/createFeatureSchema',
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
description: 'Data used to create a new feature toggle.',
|
||||||
required: ['name'],
|
required: ['name'],
|
||||||
properties: {
|
properties: {
|
||||||
name: {
|
name: {
|
||||||
|
@ -5,18 +5,27 @@ export const createInvitedUserSchema = {
|
|||||||
type: 'object',
|
type: 'object',
|
||||||
additionalProperties: false,
|
additionalProperties: false,
|
||||||
required: ['email', 'name', 'password'],
|
required: ['email', 'name', 'password'],
|
||||||
|
description: 'Data used to create a user that has been invited to Unleash.',
|
||||||
properties: {
|
properties: {
|
||||||
username: {
|
username: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
description: "The user's username. Must be unique if provided.",
|
||||||
|
example: 'Hunter',
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
description: "The invited user's email address",
|
||||||
|
example: 'hunter@example.com',
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
description: "The user's name",
|
||||||
|
example: 'Hunter Burgan',
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
description: "The user's password",
|
||||||
|
example: 'hunter2',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {},
|
components: {},
|
||||||
|
@ -2,7 +2,23 @@ import { FromSchema } from 'json-schema-to-ts';
|
|||||||
|
|
||||||
export const dateSchema = {
|
export const dateSchema = {
|
||||||
$id: '#/components/schemas/dateSchema',
|
$id: '#/components/schemas/dateSchema',
|
||||||
oneOf: [{ type: 'string', format: 'date-time' }, { type: 'number' }],
|
description:
|
||||||
|
'A representation of a date. Either as a date-time string or as a UNIX timestamp.',
|
||||||
|
oneOf: [
|
||||||
|
{
|
||||||
|
type: 'string',
|
||||||
|
format: 'date-time',
|
||||||
|
description:
|
||||||
|
'An [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339.html)-compliant timestamp.',
|
||||||
|
example: '2023-07-27T11:23:44Z',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'integer',
|
||||||
|
description:
|
||||||
|
'A [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time).',
|
||||||
|
example: 1690449593,
|
||||||
|
},
|
||||||
|
],
|
||||||
components: {},
|
components: {},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user