mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-09 01:17:06 +02:00
Refactor: expose only finished query parameters
This commit is contained in:
parent
f591feec86
commit
e6cbe0b9d6
@ -1,7 +1,8 @@
|
|||||||
import { FromSchema } from 'json-schema-to-ts';
|
import { FromSchema } from 'json-schema-to-ts';
|
||||||
import { Parameters } from '../util/request-parameters';
|
import { createQueryParameters } from '../util/query-parameters';
|
||||||
|
import { Parameters } from '../util/query-parameters';
|
||||||
|
|
||||||
export const exportParameters: Parameters = {
|
const exportParameters: Parameters = {
|
||||||
format: {
|
format: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: ['json', 'yaml'],
|
enum: ['json', 'yaml'],
|
||||||
@ -45,6 +46,8 @@ export const exportParameters: Parameters = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const exportQueryParameters = createQueryParameters(exportParameters);
|
||||||
|
|
||||||
export const exportParametersSchema = {
|
export const exportParametersSchema = {
|
||||||
$id: '#/components/schemas/exportParametersSchema',
|
$id: '#/components/schemas/exportParametersSchema',
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
@ -15,11 +15,10 @@ import { OpenApiService } from '../../services/openapi-service';
|
|||||||
import { createRequestSchema } from '../../openapi/util/create-request-schema';
|
import { createRequestSchema } from '../../openapi/util/create-request-schema';
|
||||||
import { createResponseSchema } from '../../openapi/util/create-response-schema';
|
import { createResponseSchema } from '../../openapi/util/create-response-schema';
|
||||||
import {
|
import {
|
||||||
exportParameters,
|
exportQueryParameters,
|
||||||
ExportParametersSchema,
|
ExportParametersSchema,
|
||||||
} from '../../openapi/spec/export-parameters-schema';
|
} from '../../openapi/spec/export-parameters-schema';
|
||||||
import { emptyResponse } from '../../openapi/util/standard-responses';
|
import { emptyResponse } from '../../openapi/util/standard-responses';
|
||||||
import { createQueryParameters } from '../../openapi/util/query-parameters';
|
|
||||||
|
|
||||||
const upload = multer({ limits: { fileSize: 5242880 } });
|
const upload = multer({ limits: { fileSize: 5242880 } });
|
||||||
const paramToBool = (param, def) => {
|
const paramToBool = (param, def) => {
|
||||||
@ -79,7 +78,7 @@ class StateController extends Controller {
|
|||||||
responses: {
|
responses: {
|
||||||
200: createResponseSchema('stateSchema'),
|
200: createResponseSchema('stateSchema'),
|
||||||
},
|
},
|
||||||
parameters: createQueryParameters(exportParameters),
|
parameters: exportQueryParameters,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user