From 0f98a13b0eb00e25ac4ddc9ddd8a74eab5248f10 Mon Sep 17 00:00:00 2001 From: Ferdi Koomen Date: Wed, 4 Dec 2019 13:40:44 +0100 Subject: [PATCH] - Updated mock --- test/__snapshots__/index.spec.js.snap | 94 --------------------------- test/mock/spec-v3.json | 36 ---------- 2 files changed, 130 deletions(-) diff --git a/test/__snapshots__/index.spec.js.snap b/test/__snapshots__/index.spec.js.snap index 8be30d9f..077865aa 100644 --- a/test/__snapshots__/index.spec.js.snap +++ b/test/__snapshots__/index.spec.js.snap @@ -4653,7 +4653,6 @@ export { ModelWithNestedProperties } from './models/ModelWithNestedProperties'; export { ModelWithProperties } from './models/ModelWithProperties'; export { ModelWithReference } from './models/ModelWithReference'; export { ModelWithString } from './models/ModelWithString'; -export { ProblemDetails } from './models/ProblemDetails'; export { SimpleBoolean } from './models/SimpleBoolean'; export { SimpleFile } from './models/SimpleFile'; export { SimpleInteger } from './models/SimpleInteger'; @@ -5762,48 +5761,6 @@ export let ModelWithString; })(ModelWithString || (ModelWithString = {}));" `; -exports[`generation v3 javascript file(./test/result/v3/javascript/models/ProblemDetails.js): ./test/result/v3/javascript/models/ProblemDetails.js 1`] = ` -"/* istanbul ignore file */ -/* eslint-disable */ -/* prettier-ignore */ - - -import * as yup from 'yup'; - -export let ProblemDetails; -(function (ProblemDetails) { - - ProblemDetails.schema = ( - yup.object().shape({ - detail: yup.string().nullable(), - extensions: yup.lazy(value => { - return yup.object().shape( - Object.keys(value).reduce((object, key) => ({ - ...object, - [key]: ( - yup.object() - ) - }), {}) - ).noUnknown(); - }), - instance: yup.string().nullable(), - status: yup.number().nullable(), - title: yup.string().nullable(), - type: yup.string().nullable() - }).noUnknown() - ); - - ProblemDetails.validate = async function(value) { - return ProblemDetails.schema.validate(value, { strict: true }); - }; - - ProblemDetails.validateSync = function(value) { - return ProblemDetails.schema.validateSync(value, { strict: true }); - }; - -})(ProblemDetails || (ProblemDetails = {}));" -`; - exports[`generation v3 javascript file(./test/result/v3/javascript/models/SimpleBoolean.js): ./test/result/v3/javascript/models/SimpleBoolean.js 1`] = ` "/* istanbul ignore file */ /* eslint-disable */ @@ -6785,7 +6742,6 @@ export { ModelWithNestedProperties } from './models/ModelWithNestedProperties'; export { ModelWithProperties } from './models/ModelWithProperties'; export { ModelWithReference } from './models/ModelWithReference'; export { ModelWithString } from './models/ModelWithString'; -export { ProblemDetails } from './models/ProblemDetails'; export { SimpleBoolean } from './models/SimpleBoolean'; export { SimpleFile } from './models/SimpleFile'; export { SimpleInteger } from './models/SimpleInteger'; @@ -8023,56 +7979,6 @@ export namespace ModelWithString { }" `; -exports[`generation v3 typescript file(./test/result/v3/typescript/models/ProblemDetails.ts): ./test/result/v3/typescript/models/ProblemDetails.ts 1`] = ` -"/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/* prettier-ignore */ - -import { Dictionary } from '../models/Dictionary'; -import * as yup from 'yup'; - -export interface ProblemDetails { - detail?: string | null; - readonly extensions?: Dictionary | null; - instance?: string | null; - status?: number | null; - title?: string | null; - type?: string | null; -} - -export namespace ProblemDetails { - - export const schema: yup.ObjectSchema = ( - yup.object().shape({ - detail: yup.string().nullable(), - extensions: yup.lazy>(value => { - return yup.object>().shape( - Object.keys(value).reduce((object, key) => ({ - ...object, - [key]: ( - yup.object() - ) - }), {}) - ).noUnknown(); - }), - instance: yup.string().nullable(), - status: yup.number().nullable(), - title: yup.string().nullable(), - type: yup.string().nullable() - }).noUnknown() - ); - - export async function validate(value: any): Promise { - return schema.validate(value, { strict: true }); - } - - export function validateSync(value: any): ProblemDetails { - return schema.validateSync(value, { strict: true }); - } -}" -`; - exports[`generation v3 typescript file(./test/result/v3/typescript/models/SimpleBoolean.ts): ./test/result/v3/typescript/models/SimpleBoolean.ts 1`] = ` "/* istanbul ignore file */ /* tslint:disable */ diff --git a/test/mock/spec-v3.json b/test/mock/spec-v3.json index 3ee2bcfb..133731c6 100644 --- a/test/mock/spec-v3.json +++ b/test/mock/spec-v3.json @@ -801,42 +801,6 @@ } } }, - "ProblemDetails": { - "type": "object", - "properties": { - "type": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "status": { - "type": "integer", - "format": "int32", - "nullable": true - }, - "detail": { - "type": "string", - "nullable": true - }, - "instance": { - "type": "string", - "nullable": true - }, - "extensions": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": false - }, - "nullable": true, - "readOnly": true - } - }, - "additionalProperties": false - }, "ModelWithArray": { "description": "This is a model with one property containing an array", "type": "object",