From 48584098626dad982b2bdac53fe145c2e04d02a7 Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Mon, 25 Dec 2023 14:50:38 +0800 Subject: [PATCH] fix: properly handle nullable fields in openapi generator --- packages/plugins/openapi/package.json | 3 + .../plugins/openapi/src/generator-base.ts | 40 + .../plugins/openapi/src/rest-generator.ts | 90 +- packages/plugins/openapi/src/rpc-generator.ts | 64 +- .../tests/baseline/rest-3.0.0.baseline.yaml | 2599 ++++++++ ...baseline.yaml => rest-3.1.0.baseline.yaml} | 793 ++- .../rest-type-coverage-3.0.0.baseline.yaml | 803 +++ ...=> rest-type-coverage-3.1.0.baseline.yaml} | 8 +- ....baseline.yaml => rpc-3.0.0.baseline.yaml} | 1975 +++++- .../tests/baseline/rpc-3.1.0.baseline.yaml | 5477 +++++++++++++++++ ... => rpc-type-coverage-3.0.0.baseline.yaml} | 186 +- .../rpc-type-coverage-3.1.0.baseline.yaml | 2815 +++++++++ .../openapi/tests/openapi-restful.test.ts | 135 +- .../plugins/openapi/tests/openapi-rpc.test.ts | 135 +- packages/plugins/swr/tests/swr.test.ts | 3 +- .../tanstack-query/tests/plugin.test.ts | 13 +- packages/plugins/trpc/tests/trpc.test.ts | 20 +- pnpm-lock.yaml | 17 +- 18 files changed, 14726 insertions(+), 450 deletions(-) create mode 100644 packages/plugins/openapi/tests/baseline/rest-3.0.0.baseline.yaml rename packages/plugins/openapi/tests/baseline/{rest.baseline.yaml => rest-3.1.0.baseline.yaml} (71%) create mode 100644 packages/plugins/openapi/tests/baseline/rest-type-coverage-3.0.0.baseline.yaml rename packages/plugins/openapi/tests/baseline/{rest-type-coverage.baseline.yaml => rest-type-coverage-3.1.0.baseline.yaml} (100%) rename packages/plugins/openapi/tests/baseline/{rpc.baseline.yaml => rpc-3.0.0.baseline.yaml} (67%) create mode 100644 packages/plugins/openapi/tests/baseline/rpc-3.1.0.baseline.yaml rename packages/plugins/openapi/tests/baseline/{rpc-type-coverage.baseline.yaml => rpc-type-coverage-3.0.0.baseline.yaml} (94%) create mode 100644 packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.1.0.baseline.yaml diff --git a/packages/plugins/openapi/package.json b/packages/plugins/openapi/package.json index 9dcadfab2..f576acc09 100644 --- a/packages/plugins/openapi/package.json +++ b/packages/plugins/openapi/package.json @@ -32,7 +32,9 @@ "change-case": "^4.1.2", "lower-case-first": "^2.0.2", "openapi-types": "^12.1.0", + "semver": "^7.3.8", "tiny-invariant": "^1.3.1", + "ts-pattern": "^4.3.0", "upper-case-first": "^2.0.2", "yaml": "^2.2.1", "zod": "^3.22.4", @@ -41,6 +43,7 @@ "devDependencies": { "@readme/openapi-parser": "^2.4.0", "@types/pluralize": "^0.0.29", + "@types/semver": "^7.3.13", "@types/tmp": "^0.2.3", "@zenstackhq/testtools": "workspace:*", "pluralize": "^8.0.0", diff --git a/packages/plugins/openapi/src/generator-base.ts b/packages/plugins/openapi/src/generator-base.ts index 5f3e5d933..d00c081fc 100644 --- a/packages/plugins/openapi/src/generator-base.ts +++ b/packages/plugins/openapi/src/generator-base.ts @@ -4,8 +4,11 @@ import { Model } from '@zenstackhq/sdk/ast'; import type { OpenAPIV3_1 as OAPI } from 'openapi-types'; import { fromZodError } from 'zod-validation-error'; import { SecuritySchemesSchema } from './schema'; +import semver from 'semver'; export abstract class OpenAPIGeneratorBase { + protected readonly DEFAULT_SPEC_VERSION = '3.1.0'; + constructor(protected model: Model, protected options: PluginOptions, protected dmmf: DMMF.Document) {} abstract generate(): string[]; @@ -25,6 +28,43 @@ export abstract class OpenAPIGeneratorBase { } } + protected wrapNullable( + schema: OAPI.ReferenceObject | OAPI.SchemaObject, + isNullable: boolean + ): OAPI.ReferenceObject | OAPI.SchemaObject { + if (!isNullable) { + return schema; + } + + const specVersion = this.getOption('specVersion', this.DEFAULT_SPEC_VERSION); + + // https://stackoverflow.com/questions/48111459/how-to-define-a-property-that-can-be-string-or-null-in-openapi-swagger + // https://stackoverflow.com/questions/40920441/how-to-specify-a-property-can-be-null-or-a-reference-with-swagger + if (semver.gte(specVersion, '3.1.0')) { + // OAPI 3.1.0 and above has native 'null' type + if ((schema as OAPI.BaseSchemaObject).oneOf) { + // merge into existing 'oneOf' + return { oneOf: [...(schema as OAPI.BaseSchemaObject).oneOf!, { type: 'null' }] }; + } else { + // wrap into a 'oneOf' + return { oneOf: [{ type: 'null' }, schema] }; + } + } else { + if ((schema as OAPI.ReferenceObject).$ref) { + // nullable $ref needs to be represented as: { allOf: [{ $ref: ... }], nullable: true } + return { + allOf: [schema], + nullable: true, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any; + } else { + // nullable scalar: { type: ..., nullable: true } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return { ...schema, nullable: true } as any; + } + } + } + protected array(itemType: OAPI.SchemaObject | OAPI.ReferenceObject) { return { type: 'array', items: itemType } as const; } diff --git a/packages/plugins/openapi/src/rest-generator.ts b/packages/plugins/openapi/src/rest-generator.ts index 70b2dd18a..9dceeec3e 100644 --- a/packages/plugins/openapi/src/rest-generator.ts +++ b/packages/plugins/openapi/src/rest-generator.ts @@ -12,12 +12,13 @@ import { resolvePath, } from '@zenstackhq/sdk'; import { DataModel, DataModelField, DataModelFieldType, Enum, isDataModel, isEnum } from '@zenstackhq/sdk/ast'; -import * as fs from 'fs'; +import fs from 'fs'; import { lowerCaseFirst } from 'lower-case-first'; import type { OpenAPIV3_1 as OAPI } from 'openapi-types'; -import * as path from 'path'; +import path from 'path'; import pluralize from 'pluralize'; import invariant from 'tiny-invariant'; +import { P, match } from 'ts-pattern'; import YAML from 'yaml'; import { name } from '.'; import { OpenAPIGeneratorBase } from './generator-base'; @@ -49,7 +50,7 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase { } const openapi: OAPI.Document = { - openapi: this.getOption('specVersion', '3.1.0'), + openapi: this.getOption('specVersion', this.DEFAULT_SPEC_VERSION), info: { title: this.getOption('title', 'ZenStack Generated API'), version: this.getOption('version', '1.0.0'), @@ -483,9 +484,8 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase { schema = this.fieldTypeToOpenAPISchema(field.type); } } - if (array) { - schema = { type: 'array', items: schema }; - } + + schema = this.wrapArray(schema, array); return { name: name === 'id' ? 'filter[id]' : `filter[${field.name}${name}]`, @@ -576,10 +576,10 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase { description: 'Pagination information', required: ['first', 'last', 'prev', 'next'], properties: { - first: this.nullable({ type: 'string', description: 'Link to the first page' }), - last: this.nullable({ type: 'string', description: 'Link to the last page' }), - prev: this.nullable({ type: 'string', description: 'Link to the previous page' }), - next: this.nullable({ type: 'string', description: 'Link to the next page' }), + first: this.wrapNullable({ type: 'string', description: 'Link to the first page' }, true), + last: this.wrapNullable({ type: 'string', description: 'Link to the last page' }, true), + prev: this.wrapNullable({ type: 'string', description: 'Link to the previous page' }, true), + next: this.wrapNullable({ type: 'string', description: 'Link to the next page' }, true), }, }, _errors: { @@ -634,7 +634,7 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase { type: 'object', description: 'A to-one relationship', properties: { - data: this.nullable(this.ref('_resourceIdentifier')), + data: this.wrapNullable(this.ref('_resourceIdentifier'), true), }, }, _toOneRelationshipWithLinks: { @@ -643,7 +643,7 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase { description: 'A to-one relationship with links', properties: { links: this.ref('_relationLinks'), - data: this.nullable(this.ref('_resourceIdentifier')), + data: this.wrapNullable(this.ref('_resourceIdentifier'), true), }, }, _toManyRelationship: { @@ -680,13 +680,16 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase { }, _toOneRelationshipRequest: { description: 'Input for manipulating a to-one relationship', - ...this.nullable({ - type: 'object', - required: ['data'], - properties: { - data: this.ref('_resourceIdentifier'), + ...this.wrapNullable( + { + type: 'object', + required: ['data'], + properties: { + data: this.ref('_resourceIdentifier'), + }, }, - }), + true + ), }, _toManyRelationshipResponse: { description: 'Response for a to-many relationship', @@ -841,7 +844,7 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase { const fields = model.fields.filter((f) => !isIdField(f)); const attributes: Record = {}; - const relationships: Record = {}; + const relationships: Record = {}; const required: string[] = []; @@ -853,7 +856,7 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase { } else { relType = field.type.array ? '_toManyRelationshipWithLinks' : '_toOneRelationshipWithLinks'; } - relationships[field.name] = this.ref(relType); + relationships[field.name] = this.wrapNullable(this.ref(relType), field.type.optional); } else { attributes[field.name] = this.generateField(field); if ( @@ -911,48 +914,33 @@ export class RESTfulOpenAPIGenerator extends OpenAPIGeneratorBase { } private generateField(field: DataModelField) { - return this.wrapArray(this.fieldTypeToOpenAPISchema(field.type), field.type.array); - } - - private get specVersion() { - return this.getOption('specVersion', '3.0.0'); + return this.wrapArray( + this.wrapNullable(this.fieldTypeToOpenAPISchema(field.type), field.type.optional), + field.type.array + ); } private fieldTypeToOpenAPISchema(type: DataModelFieldType): OAPI.ReferenceObject | OAPI.SchemaObject { - switch (type.type) { - case 'String': - return { type: 'string' }; - case 'Int': - case 'BigInt': - return { type: 'integer' }; - case 'Float': - return { type: 'number' }; - case 'Decimal': - return this.oneOf({ type: 'number' }, { type: 'string' }); - case 'Boolean': - return { type: 'boolean' }; - case 'DateTime': - return { type: 'string', format: 'date-time' }; - case 'Bytes': - return { type: 'string', format: 'byte', description: 'Base64 encoded byte array' }; - case 'Json': - return {}; - default: { + return match(type.type) + .with('String', () => ({ type: 'string' })) + .with(P.union('Int', 'BigInt'), () => ({ type: 'integer' })) + .with('Float', () => ({ type: 'number' })) + .with('Decimal', () => this.oneOf({ type: 'number' }, { type: 'string' })) + .with('Boolean', () => ({ type: 'boolean' })) + .with('DateTime', () => ({ type: 'string', format: 'date-time' })) + .with('Bytes', () => ({ type: 'string', format: 'byte', description: 'Base64 encoded byte array' })) + .with('Json', () => ({})) + .otherwise((t) => { const fieldDecl = type.reference?.ref; - invariant(fieldDecl); + invariant(fieldDecl, `Type ${t} is not a model reference`); return this.ref(fieldDecl?.name); - } - } + }); } private ref(type: string) { return { $ref: `#/components/schemas/${type}` }; } - private nullable(schema: OAPI.SchemaObject | OAPI.ReferenceObject) { - return this.specVersion === '3.0.0' ? { ...schema, nullable: true } : this.oneOf(schema, { type: 'null' }); - } - private parameter(type: string) { return { $ref: `#/components/parameters/${type}` }; } diff --git a/packages/plugins/openapi/src/rpc-generator.ts b/packages/plugins/openapi/src/rpc-generator.ts index 207dd66bf..13bb91272 100644 --- a/packages/plugins/openapi/src/rpc-generator.ts +++ b/packages/plugins/openapi/src/rpc-generator.ts @@ -16,6 +16,7 @@ import { lowerCaseFirst } from 'lower-case-first'; import type { OpenAPIV3_1 as OAPI } from 'openapi-types'; import * as path from 'path'; import invariant from 'tiny-invariant'; +import { match, P } from 'ts-pattern'; import { upperCaseFirst } from 'upper-case-first'; import YAML from 'yaml'; import { name } from '.'; @@ -62,7 +63,7 @@ export class RPCOpenAPIGenerator extends OpenAPIGeneratorBase { this.pruneComponents(paths, components); const openapi: OAPI.Document = { - openapi: this.getOption('specVersion', '3.1.0'), + openapi: this.getOption('specVersion', this.DEFAULT_SPEC_VERSION), info: { title: this.getOption('title', 'ZenStack Generated API'), version: this.getOption('version', '1.0.0'), @@ -710,14 +711,14 @@ export class RPCOpenAPIGenerator extends OpenAPIGeneratorBase { return result; } - private generateField(def: { kind: DMMF.FieldKind; type: string; isList: boolean }) { + private generateField(def: { kind: DMMF.FieldKind; type: string; isList: boolean; isRequired: boolean }) { switch (def.kind) { case 'scalar': - return this.wrapArray(this.prismaTypeToOpenAPIType(def.type), def.isList); + return this.wrapArray(this.prismaTypeToOpenAPIType(def.type, !def.isRequired), def.isList); case 'enum': case 'object': - return this.wrapArray(this.ref(def.type, false), def.isList); + return this.wrapArray(this.wrapNullable(this.ref(def.type, false), !def.isRequired), def.isList); default: throw new PluginError(this.options.name, `Unsupported field kind: ${def.kind}`); @@ -735,9 +736,18 @@ export class RPCOpenAPIGenerator extends OpenAPIGeneratorBase { f.location !== 'fieldRefTypes' ) .map((f) => { - return this.wrapArray(this.prismaTypeToOpenAPIType(f.type), f.isList); + return this.wrapArray(this.prismaTypeToOpenAPIType(f.type, false), f.isList); }); - properties[field.name] = options.length > 1 ? { oneOf: options } : options[0]; + + let prop = options.length > 1 ? { oneOf: options } : options[0]; + + // if types include 'Null', make it nullable + prop = this.wrapNullable( + prop, + field.inputTypes.some((f) => f.type === 'Null') + ); + + properties[field.name] = prop; } const result: OAPI.SchemaObject = { type: 'object', properties }; @@ -752,11 +762,12 @@ export class RPCOpenAPIGenerator extends OpenAPIGeneratorBase { switch (field.outputType.location) { case 'scalar': case 'enumTypes': - outputType = this.prismaTypeToOpenAPIType(field.outputType.type); + outputType = this.prismaTypeToOpenAPIType(field.outputType.type, !!field.isNullable); break; case 'outputObjectTypes': outputType = this.prismaTypeToOpenAPIType( - typeof field.outputType.type === 'string' ? field.outputType.type : field.outputType.type.name + typeof field.outputType.type === 'string' ? field.outputType.type : field.outputType.type.name, + !!field.isNullable ); break; } @@ -786,30 +797,19 @@ export class RPCOpenAPIGenerator extends OpenAPIGeneratorBase { } } - private prismaTypeToOpenAPIType(type: DMMF.ArgType): OAPI.ReferenceObject | OAPI.SchemaObject { - switch (type) { - case 'String': - return { type: 'string' }; - case 'Int': - case 'BigInt': - return { type: 'integer' }; - case 'Float': - return { type: 'number' }; - case 'Decimal': - return this.oneOf({ type: 'string' }, { type: 'number' }); - case 'Boolean': - case 'True': - return { type: 'boolean' }; - case 'DateTime': - return { type: 'string', format: 'date-time' }; - case 'Bytes': - return { type: 'string', format: 'byte' }; - case 'JSON': - case 'Json': - return {}; - default: - return this.ref(type.toString(), false); - } + private prismaTypeToOpenAPIType(type: DMMF.ArgType, nullable: boolean): OAPI.ReferenceObject | OAPI.SchemaObject { + const result = match(type) + .with('String', () => ({ type: 'string' })) + .with(P.union('Int', 'BigInt'), () => ({ type: 'integer' })) + .with('Float', () => ({ type: 'number' })) + .with('Decimal', () => this.oneOf({ type: 'string' }, { type: 'number' })) + .with(P.union('Boolean', 'True'), () => ({ type: 'boolean' })) + .with('DateTime', () => ({ type: 'string', format: 'date-time' })) + .with('Bytes', () => ({ type: 'string', format: 'byte' })) + .with(P.union('JSON', 'Json'), () => ({})) + .otherwise((type) => this.ref(type.toString(), false)); + + return this.wrapNullable(result, nullable); } private ref(type: string, rooted = true, description?: string): OAPI.ReferenceObject { diff --git a/packages/plugins/openapi/tests/baseline/rest-3.0.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rest-3.0.0.baseline.yaml new file mode 100644 index 000000000..2bdc154a5 --- /dev/null +++ b/packages/plugins/openapi/tests/baseline/rest-3.0.0.baseline.yaml @@ -0,0 +1,2599 @@ +openapi: 3.0.0 +info: + title: ZenStack Generated API + version: 1.0.0 +tags: + - name: user + description: User operations + - name: profile + description: Profile operations + - name: post_Item + description: Post-related operations +paths: + /user: + get: + operationId: list-User + description: List "User" resources + tags: + - user + parameters: + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/page-offset' + - $ref: '#/components/parameters/page-limit' + - name: filter[id] + required: false + description: Id filter + in: query + style: form + explode: false + schema: + type: string + - name: filter[createdAt] + required: false + description: Equality filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$lt] + required: false + description: Less-than filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$lte] + required: false + description: Less-than or equal filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$gt] + required: false + description: Greater-than filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$gte] + required: false + description: Greater-than or equal filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt] + required: false + description: Equality filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$lt] + required: false + description: Less-than filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$lte] + required: false + description: Less-than or equal filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$gt] + required: false + description: Greater-than filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$gte] + required: false + description: Greater-than or equal filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[email] + required: false + description: Equality filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$contains] + required: false + description: String contains filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$icontains] + required: false + description: String case-insensitive contains filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$search] + required: false + description: String full-text search filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$startsWith] + required: false + description: String startsWith filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$endsWith] + required: false + description: String endsWith filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[role] + required: false + description: Equality filter for "role" + in: query + style: form + explode: false + schema: + $ref: '#/components/schemas/role' + - name: filter[posts] + required: false + description: Equality filter for "posts" + in: query + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter[profile] + required: false + description: Equality filter for "profile" + in: query + style: form + explode: false + schema: + type: string + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserListResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + post: + operationId: create-User + description: Create a "User" resource + tags: + - user + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserCreateRequest' + responses: + '201': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/user/{id}': + get: + operationId: fetch-User + description: Fetch a "User" resource + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-User-put + description: Update a "User" resource + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserUpdateRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + patch: + operationId: update-User-patch + description: Update a "User" resource + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserUpdateRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + delete: + operationId: delete-User + description: Delete a "User" resource + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + responses: + '200': + description: Successful operation + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/user/{id}/posts': + get: + operationId: fetch-User-related-posts + description: Fetch the related "posts" resource for "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/page-offset' + - $ref: '#/components/parameters/page-limit' + - name: filter[id] + required: false + description: Id filter + in: query + style: form + explode: false + schema: + type: string + - name: filter[createdAt] + required: false + description: Equality filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$lt] + required: false + description: Less-than filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$lte] + required: false + description: Less-than or equal filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$gt] + required: false + description: Greater-than filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$gte] + required: false + description: Greater-than or equal filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt] + required: false + description: Equality filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$lt] + required: false + description: Less-than filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$lte] + required: false + description: Less-than or equal filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$gt] + required: false + description: Greater-than filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$gte] + required: false + description: Greater-than or equal filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[email] + required: false + description: Equality filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$contains] + required: false + description: String contains filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$icontains] + required: false + description: String case-insensitive contains filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$search] + required: false + description: String full-text search filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$startsWith] + required: false + description: String startsWith filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$endsWith] + required: false + description: String endsWith filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[role] + required: false + description: Equality filter for "role" + in: query + style: form + explode: false + schema: + $ref: '#/components/schemas/role' + - name: filter[posts] + required: false + description: Equality filter for "posts" + in: query + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter[profile] + required: false + description: Equality filter for "profile" + in: query + style: form + explode: false + schema: + type: string + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/post_ItemListResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/user/{id}/relationships/posts': + get: + operationId: fetch-User-relationship-posts + description: Fetch the "posts" relationships for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/page-offset' + - $ref: '#/components/parameters/page-limit' + - name: filter[id] + required: false + description: Id filter + in: query + style: form + explode: false + schema: + type: string + - name: filter[createdAt] + required: false + description: Equality filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$lt] + required: false + description: Less-than filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$lte] + required: false + description: Less-than or equal filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$gt] + required: false + description: Greater-than filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$gte] + required: false + description: Greater-than or equal filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt] + required: false + description: Equality filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$lt] + required: false + description: Less-than filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$lte] + required: false + description: Less-than or equal filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$gt] + required: false + description: Greater-than filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$gte] + required: false + description: Greater-than or equal filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[email] + required: false + description: Equality filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$contains] + required: false + description: String contains filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$icontains] + required: false + description: String case-insensitive contains filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$search] + required: false + description: String full-text search filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$startsWith] + required: false + description: String startsWith filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[email$endsWith] + required: false + description: String endsWith filter for "email" + in: query + style: form + explode: false + schema: + type: string + - name: filter[role] + required: false + description: Equality filter for "role" + in: query + style: form + explode: false + schema: + $ref: '#/components/schemas/role' + - name: filter[posts] + required: false + description: Equality filter for "posts" + in: query + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter[profile] + required: false + description: Equality filter for "profile" + in: query + style: form + explode: false + schema: + type: string + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-User-relationship-posts-put + description: Update "posts" relationships for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + patch: + operationId: update-User-relationship-posts-patch + description: Update "posts" relationships for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + post: + operationId: create-User-relationship-posts + description: Create new "posts" relationships for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/user/{id}/profile': + get: + operationId: fetch-User-related-profile + description: Fetch the related "profile" resource for "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/user/{id}/relationships/profile': + get: + operationId: fetch-User-relationship-profile + description: Fetch the "profile" relationships for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-User-relationship-profile-put + description: Update "profile" relationship for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + patch: + operationId: update-User-relationship-profile-patch + description: Update "profile" relationship for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + /profile: + get: + operationId: list-Profile + description: List "Profile" resources + tags: + - profile + parameters: + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/page-offset' + - $ref: '#/components/parameters/page-limit' + - name: filter[id] + required: false + description: Id filter + in: query + style: form + explode: false + schema: + type: string + - name: filter[image] + required: false + description: Equality filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[image$contains] + required: false + description: String contains filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[image$icontains] + required: false + description: String case-insensitive contains filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[image$search] + required: false + description: String full-text search filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[image$startsWith] + required: false + description: String startsWith filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[image$endsWith] + required: false + description: String endsWith filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[user] + required: false + description: Equality filter for "user" + in: query + style: form + explode: false + schema: + type: string + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileListResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + post: + operationId: create-Profile + description: Create a "Profile" resource + tags: + - profile + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileCreateRequest' + responses: + '201': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/profile/{id}': + get: + operationId: fetch-Profile + description: Fetch a "Profile" resource + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-Profile-put + description: Update a "Profile" resource + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileUpdateRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + patch: + operationId: update-Profile-patch + description: Update a "Profile" resource + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileUpdateRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + delete: + operationId: delete-Profile + description: Delete a "Profile" resource + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + responses: + '200': + description: Successful operation + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/profile/{id}/user': + get: + operationId: fetch-Profile-related-user + description: Fetch the related "user" resource for "Profile" + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/profile/{id}/relationships/user': + get: + operationId: fetch-Profile-relationship-user + description: Fetch the "user" relationships for a "Profile" + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-Profile-relationship-user-put + description: Update "user" relationship for a "Profile" + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + patch: + operationId: update-Profile-relationship-user-patch + description: Update "user" relationship for a "Profile" + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + /post_Item: + get: + operationId: list-post_Item + description: List "post_Item" resources + tags: + - post_Item + parameters: + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/page-offset' + - $ref: '#/components/parameters/page-limit' + - name: filter[id] + required: false + description: Id filter + in: query + style: form + explode: false + schema: + type: string + - name: filter[createdAt] + required: false + description: Equality filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$lt] + required: false + description: Less-than filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$lte] + required: false + description: Less-than or equal filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$gt] + required: false + description: Greater-than filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[createdAt$gte] + required: false + description: Greater-than or equal filter for "createdAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt] + required: false + description: Equality filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$lt] + required: false + description: Less-than filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$lte] + required: false + description: Less-than or equal filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$gt] + required: false + description: Greater-than filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[updatedAt$gte] + required: false + description: Greater-than or equal filter for "updatedAt" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[title] + required: false + description: Equality filter for "title" + in: query + style: form + explode: false + schema: + type: string + - name: filter[title$contains] + required: false + description: String contains filter for "title" + in: query + style: form + explode: false + schema: + type: string + - name: filter[title$icontains] + required: false + description: String case-insensitive contains filter for "title" + in: query + style: form + explode: false + schema: + type: string + - name: filter[title$search] + required: false + description: String full-text search filter for "title" + in: query + style: form + explode: false + schema: + type: string + - name: filter[title$startsWith] + required: false + description: String startsWith filter for "title" + in: query + style: form + explode: false + schema: + type: string + - name: filter[title$endsWith] + required: false + description: String endsWith filter for "title" + in: query + style: form + explode: false + schema: + type: string + - name: filter[author] + required: false + description: Equality filter for "author" + in: query + style: form + explode: false + schema: + type: string + - name: filter[published] + required: false + description: Equality filter for "published" + in: query + style: form + explode: false + schema: + type: boolean + - name: filter[viewCount] + required: false + description: Equality filter for "viewCount" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[viewCount$lt] + required: false + description: Less-than filter for "viewCount" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[viewCount$lte] + required: false + description: Less-than or equal filter for "viewCount" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[viewCount$gt] + required: false + description: Greater-than filter for "viewCount" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[viewCount$gte] + required: false + description: Greater-than or equal filter for "viewCount" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[notes] + required: false + description: Equality filter for "notes" + in: query + style: form + explode: false + schema: + type: string + - name: filter[notes$contains] + required: false + description: String contains filter for "notes" + in: query + style: form + explode: false + schema: + type: string + - name: filter[notes$icontains] + required: false + description: String case-insensitive contains filter for "notes" + in: query + style: form + explode: false + schema: + type: string + - name: filter[notes$search] + required: false + description: String full-text search filter for "notes" + in: query + style: form + explode: false + schema: + type: string + - name: filter[notes$startsWith] + required: false + description: String startsWith filter for "notes" + in: query + style: form + explode: false + schema: + type: string + - name: filter[notes$endsWith] + required: false + description: String endsWith filter for "notes" + in: query + style: form + explode: false + schema: + type: string + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/post_ItemListResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + post: + operationId: create-post_Item + description: Create a "post_Item" resource + tags: + - post_Item + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/post_ItemCreateRequest' + responses: + '201': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/post_ItemResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/post_Item/{id}': + get: + operationId: fetch-post_Item + description: Fetch a "post_Item" resource + tags: + - post_Item + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/post_ItemResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-post_Item-put + description: Update a "post_Item" resource + tags: + - post_Item + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/post_ItemUpdateRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/post_ItemResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + patch: + operationId: update-post_Item-patch + description: Update a "post_Item" resource + tags: + - post_Item + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/post_ItemUpdateRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/post_ItemResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + delete: + operationId: delete-post_Item + description: Delete a "post_Item" resource + tags: + - post_Item + parameters: + - $ref: '#/components/parameters/id' + responses: + '200': + description: Successful operation + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/post_Item/{id}/author': + get: + operationId: fetch-post_Item-related-author + description: Fetch the related "author" resource for "post_Item" + tags: + - post_Item + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/post_Item/{id}/relationships/author': + get: + operationId: fetch-post_Item-relationship-author + description: Fetch the "author" relationships for a "post_Item" + tags: + - post_Item + parameters: + - $ref: '#/components/parameters/id' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-post_Item-relationship-author-put + description: Update "author" relationship for a "post_Item" + tags: + - post_Item + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + patch: + operationId: update-post_Item-relationship-author-patch + description: Update "author" relationship for a "post_Item" + tags: + - post_Item + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' +components: + schemas: + _jsonapi: + type: object + description: An object describing the server’s implementation + required: + - version + properties: + version: + type: string + _meta: + type: object + description: Meta information about the request or response + properties: + serialization: + description: Superjson serialization metadata + additionalProperties: true + _resourceIdentifier: + type: object + description: Identifier for a resource + required: + - type + - id + properties: + type: + type: string + description: Resource type + id: + type: string + description: Resource id + _resource: + allOf: + - $ref: '#/components/schemas/_resourceIdentifier' + - type: object + description: A resource with attributes and relationships + properties: + attributes: + type: object + description: Resource attributes + relationships: + type: object + description: Resource relationships + _links: + type: object + required: + - self + description: Links related to the resource + properties: + self: + type: string + description: Link for refetching the curent results + _pagination: + type: object + description: Pagination information + required: + - first + - last + - prev + - next + properties: + first: + type: string + description: Link to the first page + nullable: true + last: + type: string + description: Link to the last page + nullable: true + prev: + type: string + description: Link to the previous page + nullable: true + next: + type: string + description: Link to the next page + nullable: true + _errors: + type: array + description: An array of error objects + items: + type: object + required: + - status + - code + properties: + status: + type: string + description: HTTP status + code: + type: string + description: Error code + prismaCode: + type: string + description: Prisma error code if the error is thrown by Prisma + title: + type: string + description: Error title + detail: + type: string + description: Error detail + reason: + type: string + description: Detailed error reason + zodErrors: + type: object + additionalProperties: true + description: Zod validation errors if the error is due to data validation + failure + _errorResponse: + type: object + required: + - errors + description: An error response + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + errors: + $ref: '#/components/schemas/_errors' + _relationLinks: + type: object + required: + - self + - related + description: Links related to a relationship + properties: + self: + type: string + description: Link for fetching this relationship + related: + type: string + description: Link for fetching the resource represented by this relationship + _toOneRelationship: + type: object + description: A to-one relationship + properties: + data: + allOf: + - $ref: '#/components/schemas/_resourceIdentifier' + nullable: true + _toOneRelationshipWithLinks: + type: object + required: + - links + - data + description: A to-one relationship with links + properties: + links: + $ref: '#/components/schemas/_relationLinks' + data: + allOf: + - $ref: '#/components/schemas/_resourceIdentifier' + nullable: true + _toManyRelationship: + type: object + required: + - data + description: A to-many relationship + properties: + data: + type: array + items: + $ref: '#/components/schemas/_resourceIdentifier' + _toManyRelationshipWithLinks: + type: object + required: + - links + - data + description: A to-many relationship with links + properties: + links: + $ref: '#/components/schemas/_pagedRelationLinks' + data: + type: array + items: + $ref: '#/components/schemas/_resourceIdentifier' + _pagedRelationLinks: + description: Relationship links with pagination information + allOf: + - $ref: '#/components/schemas/_pagination' + - $ref: '#/components/schemas/_relationLinks' + _toManyRelationshipRequest: + type: object + required: + - data + description: Input for manipulating a to-many relationship + properties: + data: + type: array + items: + $ref: '#/components/schemas/_resourceIdentifier' + _toOneRelationshipRequest: + description: Input for manipulating a to-one relationship + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/_resourceIdentifier' + nullable: true + _toManyRelationshipResponse: + description: Response for a to-many relationship + allOf: + - $ref: '#/components/schemas/_toManyRelationshipWithLinks' + - type: object + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + _toOneRelationshipResponse: + description: Response for a to-one relationship + allOf: + - $ref: '#/components/schemas/_toOneRelationshipWithLinks' + - type: object + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + role: + type: string + description: The "role" Enum + enum: + - USER + - ADMIN + User: + type: object + description: The "User" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/role' + relationships: + type: object + properties: + posts: + $ref: '#/components/schemas/_toManyRelationshipWithLinks' + profile: + allOf: + - $ref: '#/components/schemas/_toOneRelationshipWithLinks' + nullable: true + UserCreateRequest: + type: object + description: Input for creating a "User" + required: + - data + properties: + data: + type: object + description: The "User" model + required: + - type + - attributes + properties: + type: + type: string + attributes: + type: object + required: + - updatedAt + - email + properties: + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/role' + relationships: + type: object + properties: + posts: + $ref: '#/components/schemas/_toManyRelationship' + profile: + allOf: + - $ref: '#/components/schemas/_toOneRelationship' + nullable: true + meta: + $ref: '#/components/schemas/_meta' + UserUpdateRequest: + type: object + description: Input for updating a "User" + required: + - data + properties: + data: + type: object + description: The "User" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/role' + relationships: + type: object + properties: + posts: + $ref: '#/components/schemas/_toManyRelationship' + profile: + allOf: + - $ref: '#/components/schemas/_toOneRelationship' + nullable: true + meta: + $ref: '#/components/schemas/_meta' + UserResponse: + type: object + description: Response for a "User" + required: + - data + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + data: + allOf: + - $ref: '#/components/schemas/User' + - type: object + properties: + relationships: + type: object + properties: &a1 + posts: + $ref: '#/components/schemas/_toManyRelationship' + profile: + $ref: '#/components/schemas/_toOneRelationship' + meta: + $ref: '#/components/schemas/_meta' + included: + type: array + items: + $ref: '#/components/schemas/_resource' + links: + $ref: '#/components/schemas/_links' + UserListResponse: + type: object + description: Response for a list of "User" + required: + - data + - links + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/User' + - type: object + properties: + relationships: + type: object + properties: *a1 + meta: + $ref: '#/components/schemas/_meta' + included: + type: array + items: + $ref: '#/components/schemas/_resource' + links: + allOf: + - $ref: '#/components/schemas/_links' + - $ref: '#/components/schemas/_pagination' + Profile: + type: object + description: The "Profile" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + image: + type: string + nullable: true + userId: + type: string + relationships: + type: object + properties: + user: + $ref: '#/components/schemas/_toOneRelationshipWithLinks' + ProfileCreateRequest: + type: object + description: Input for creating a "Profile" + required: + - data + properties: + data: + type: object + description: The "Profile" model + required: + - type + - attributes + properties: + type: + type: string + attributes: + type: object + required: + - userId + properties: + image: + type: string + nullable: true + userId: + type: string + relationships: + type: object + properties: + user: + $ref: '#/components/schemas/_toOneRelationship' + meta: + $ref: '#/components/schemas/_meta' + ProfileUpdateRequest: + type: object + description: Input for updating a "Profile" + required: + - data + properties: + data: + type: object + description: The "Profile" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + image: + type: string + nullable: true + userId: + type: string + relationships: + type: object + properties: + user: + $ref: '#/components/schemas/_toOneRelationship' + meta: + $ref: '#/components/schemas/_meta' + ProfileResponse: + type: object + description: Response for a "Profile" + required: + - data + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + data: + allOf: + - $ref: '#/components/schemas/Profile' + - type: object + properties: + relationships: + type: object + properties: &a2 + user: + $ref: '#/components/schemas/_toOneRelationship' + meta: + $ref: '#/components/schemas/_meta' + included: + type: array + items: + $ref: '#/components/schemas/_resource' + links: + $ref: '#/components/schemas/_links' + ProfileListResponse: + type: object + description: Response for a list of "Profile" + required: + - data + - links + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/Profile' + - type: object + properties: + relationships: + type: object + properties: *a2 + meta: + $ref: '#/components/schemas/_meta' + included: + type: array + items: + $ref: '#/components/schemas/_resource' + links: + allOf: + - $ref: '#/components/schemas/_links' + - $ref: '#/components/schemas/_pagination' + post_Item: + type: object + description: The "post_Item" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + authorId: + type: string + nullable: true + published: + type: boolean + viewCount: + type: integer + notes: + type: string + nullable: true + relationships: + type: object + properties: + author: + allOf: + - $ref: '#/components/schemas/_toOneRelationshipWithLinks' + nullable: true + post_ItemCreateRequest: + type: object + description: Input for creating a "post_Item" + required: + - data + properties: + data: + type: object + description: The "post_Item" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + required: + - updatedAt + - title + properties: + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + authorId: + type: string + nullable: true + published: + type: boolean + viewCount: + type: integer + notes: + type: string + nullable: true + relationships: + type: object + properties: + author: + allOf: + - $ref: '#/components/schemas/_toOneRelationship' + nullable: true + meta: + $ref: '#/components/schemas/_meta' + post_ItemUpdateRequest: + type: object + description: Input for updating a "post_Item" + required: + - data + properties: + data: + type: object + description: The "post_Item" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + authorId: + type: string + nullable: true + published: + type: boolean + viewCount: + type: integer + notes: + type: string + nullable: true + relationships: + type: object + properties: + author: + allOf: + - $ref: '#/components/schemas/_toOneRelationship' + nullable: true + meta: + $ref: '#/components/schemas/_meta' + post_ItemResponse: + type: object + description: Response for a "post_Item" + required: + - data + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + data: + allOf: + - $ref: '#/components/schemas/post_Item' + - type: object + properties: + relationships: + type: object + properties: &a3 + author: + $ref: '#/components/schemas/_toOneRelationship' + meta: + $ref: '#/components/schemas/_meta' + included: + type: array + items: + $ref: '#/components/schemas/_resource' + links: + $ref: '#/components/schemas/_links' + post_ItemListResponse: + type: object + description: Response for a list of "post_Item" + required: + - data + - links + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/post_Item' + - type: object + properties: + relationships: + type: object + properties: *a3 + meta: + $ref: '#/components/schemas/_meta' + included: + type: array + items: + $ref: '#/components/schemas/_resource' + links: + allOf: + - $ref: '#/components/schemas/_links' + - $ref: '#/components/schemas/_pagination' + parameters: + id: + name: id + in: path + description: The resource id + required: true + schema: + type: string + include: + name: include + in: query + description: Relationships to include + required: false + style: form + schema: + type: string + sort: + name: sort + in: query + description: Fields to sort by + required: false + style: form + schema: + type: string + page-offset: + name: page[offset] + in: query + description: Offset for pagination + required: false + style: form + schema: + type: integer + page-limit: + name: page[limit] + in: query + description: Limit for pagination + required: false + style: form + schema: + type: integer diff --git a/packages/plugins/openapi/tests/baseline/rest.baseline.yaml b/packages/plugins/openapi/tests/baseline/rest-3.1.0.baseline.yaml similarity index 71% rename from packages/plugins/openapi/tests/baseline/rest.baseline.yaml rename to packages/plugins/openapi/tests/baseline/rest-3.1.0.baseline.yaml index 3421150c9..ea85b4aa3 100644 --- a/packages/plugins/openapi/tests/baseline/rest.baseline.yaml +++ b/packages/plugins/openapi/tests/baseline/rest-3.1.0.baseline.yaml @@ -5,6 +5,8 @@ info: tags: - name: user description: User operations + - name: profile + description: Profile operations - name: post_Item description: Post-related operations paths: @@ -183,6 +185,14 @@ paths: type: array items: type: string + - name: filter[profile] + required: false + description: Equality filter for "profile" + in: query + style: form + explode: false + schema: + type: string responses: '200': description: Successful operation @@ -507,6 +517,14 @@ paths: type: array items: type: string + - name: filter[profile] + required: false + description: Equality filter for "profile" + in: query + style: form + explode: false + schema: + type: string responses: '200': description: Successful operation @@ -701,13 +719,432 @@ paths: type: array items: type: string + - name: filter[profile] + required: false + description: Equality filter for "profile" + in: query + style: form + explode: false + schema: + type: string + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-User-relationship-posts-put + description: Update "posts" relationships for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + patch: + operationId: update-User-relationship-posts-patch + description: Update "posts" relationships for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + post: + operationId: create-User-relationship-posts + description: Create new "posts" relationships for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toManyRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/user/{id}/profile': + get: + operationId: fetch-User-related-profile + description: Fetch the related "profile" resource for "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/user/{id}/relationships/profile': + get: + operationId: fetch-User-relationship-profile + description: Fetch the "profile" relationships for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-User-relationship-profile-put + description: Update "profile" relationship for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + patch: + operationId: update-User-relationship-profile-patch + description: Update "profile" relationship for a "User" + tags: + - user + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + /profile: + get: + operationId: list-Profile + description: List "Profile" resources + tags: + - profile + parameters: + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/page-offset' + - $ref: '#/components/parameters/page-limit' + - name: filter[id] + required: false + description: Id filter + in: query + style: form + explode: false + schema: + type: string + - name: filter[image] + required: false + description: Equality filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[image$contains] + required: false + description: String contains filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[image$icontains] + required: false + description: String case-insensitive contains filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[image$search] + required: false + description: String full-text search filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[image$startsWith] + required: false + description: String startsWith filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[image$endsWith] + required: false + description: String endsWith filter for "image" + in: query + style: form + explode: false + schema: + type: string + - name: filter[user] + required: false + description: Equality filter for "user" + in: query + style: form + explode: false + schema: + type: string + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileListResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + post: + operationId: create-Profile + description: Create a "Profile" resource + tags: + - profile + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileCreateRequest' + responses: + '201': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/profile/{id}': + get: + operationId: fetch-Profile + description: Fetch a "Profile" resource + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-Profile-put + description: Update a "Profile" resource + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileUpdateRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + patch: + operationId: update-Profile-patch + description: Update a "Profile" resource + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/ProfileUpdateRequest' responses: '200': description: Successful operation content: application/vnd.api+json: schema: - $ref: '#/components/schemas/_toManyRelationshipResponse' + $ref: '#/components/schemas/ProfileResponse' '403': description: Request is forbidden content: @@ -720,25 +1157,44 @@ paths: application/vnd.api+json: schema: $ref: '#/components/schemas/_errorResponse' - put: - operationId: update-User-relationship-posts-put - description: Update "posts" relationships for a "User" + delete: + operationId: delete-Profile + description: Delete a "Profile" resource tags: - - user + - profile parameters: - $ref: '#/components/parameters/id' - requestBody: - content: - application/vnd.api+json: - schema: - $ref: '#/components/schemas/_toManyRelationshipRequest' responses: '200': description: Successful operation + '403': + description: Request is forbidden content: application/vnd.api+json: schema: - $ref: '#/components/schemas/_toManyRelationshipResponse' + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '/profile/{id}/user': + get: + operationId: fetch-Profile-related-user + description: Fetch the related "user" resource for "Profile" + tags: + - profile + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/UserResponse' '403': description: Request is forbidden content: @@ -751,25 +1207,52 @@ paths: application/vnd.api+json: schema: $ref: '#/components/schemas/_errorResponse' - patch: - operationId: update-User-relationship-posts-patch - description: Update "posts" relationships for a "User" + '/profile/{id}/relationships/user': + get: + operationId: fetch-Profile-relationship-user + description: Fetch the "user" relationships for a "Profile" tags: - - user + - profile + parameters: + - $ref: '#/components/parameters/id' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_toOneRelationshipResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + put: + operationId: update-Profile-relationship-user-put + description: Update "user" relationship for a "Profile" + tags: + - profile parameters: - $ref: '#/components/parameters/id' requestBody: content: application/vnd.api+json: schema: - $ref: '#/components/schemas/_toManyRelationshipRequest' + $ref: '#/components/schemas/_toOneRelationshipRequest' responses: '200': description: Successful operation content: application/vnd.api+json: schema: - $ref: '#/components/schemas/_toManyRelationshipResponse' + $ref: '#/components/schemas/_toOneRelationshipResponse' '403': description: Request is forbidden content: @@ -782,25 +1265,25 @@ paths: application/vnd.api+json: schema: $ref: '#/components/schemas/_errorResponse' - post: - operationId: create-User-relationship-posts - description: Create new "posts" relationships for a "User" + patch: + operationId: update-Profile-relationship-user-patch + description: Update "user" relationship for a "Profile" tags: - - user + - profile parameters: - $ref: '#/components/parameters/id' requestBody: content: application/vnd.api+json: schema: - $ref: '#/components/schemas/_toManyRelationshipRequest' + $ref: '#/components/schemas/_toOneRelationshipRequest' responses: '200': description: Successful operation content: application/vnd.api+json: schema: - $ref: '#/components/schemas/_toManyRelationshipResponse' + $ref: '#/components/schemas/_toOneRelationshipResponse' '403': description: Request is forbidden content: @@ -1026,6 +1509,54 @@ paths: explode: false schema: type: integer + - name: filter[notes] + required: false + description: Equality filter for "notes" + in: query + style: form + explode: false + schema: + type: string + - name: filter[notes$contains] + required: false + description: String contains filter for "notes" + in: query + style: form + explode: false + schema: + type: string + - name: filter[notes$icontains] + required: false + description: String case-insensitive contains filter for "notes" + in: query + style: form + explode: false + schema: + type: string + - name: filter[notes$search] + required: false + description: String full-text search filter for "notes" + in: query + style: form + explode: false + schema: + type: string + - name: filter[notes$startsWith] + required: false + description: String startsWith filter for "notes" + in: query + style: form + explode: false + schema: + type: string + - name: filter[notes$endsWith] + required: false + description: String endsWith filter for "notes" + in: query + style: form + explode: false + schema: + type: string responses: '200': description: Successful operation @@ -1353,24 +1884,24 @@ components: properties: first: oneOf: + - type: 'null' - type: string description: Link to the first page - - type: 'null' last: oneOf: + - type: 'null' - type: string description: Link to the last page - - type: 'null' prev: oneOf: + - type: 'null' - type: string description: Link to the previous page - - type: 'null' next: oneOf: + - type: 'null' - type: string description: Link to the next page - - type: 'null' _errors: type: array description: An array of error objects @@ -1432,8 +1963,8 @@ components: properties: data: oneOf: - - $ref: '#/components/schemas/_resourceIdentifier' - type: 'null' + - $ref: '#/components/schemas/_resourceIdentifier' _toOneRelationshipWithLinks: type: object required: @@ -1445,8 +1976,8 @@ components: $ref: '#/components/schemas/_relationLinks' data: oneOf: - - $ref: '#/components/schemas/_resourceIdentifier' - type: 'null' + - $ref: '#/components/schemas/_resourceIdentifier' _toManyRelationship: type: object required: @@ -1488,13 +2019,13 @@ components: _toOneRelationshipRequest: description: Input for manipulating a to-one relationship oneOf: + - type: 'null' - type: object required: - data properties: data: $ref: '#/components/schemas/_resourceIdentifier' - - type: 'null' _toManyRelationshipResponse: description: Response for a to-many relationship allOf: @@ -1547,6 +2078,10 @@ components: properties: posts: $ref: '#/components/schemas/_toManyRelationshipWithLinks' + profile: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/_toOneRelationshipWithLinks' UserCreateRequest: type: object description: Input for creating a "User" @@ -1583,6 +2118,10 @@ components: properties: posts: $ref: '#/components/schemas/_toManyRelationship' + profile: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/_toOneRelationship' meta: $ref: '#/components/schemas/_meta' UserUpdateRequest: @@ -1621,6 +2160,10 @@ components: properties: posts: $ref: '#/components/schemas/_toManyRelationship' + profile: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/_toOneRelationship' meta: $ref: '#/components/schemas/_meta' UserResponse: @@ -1641,6 +2184,8 @@ components: properties: &a1 posts: $ref: '#/components/schemas/_toManyRelationship' + profile: + $ref: '#/components/schemas/_toOneRelationship' meta: $ref: '#/components/schemas/_meta' included: @@ -1678,6 +2223,154 @@ components: allOf: - $ref: '#/components/schemas/_links' - $ref: '#/components/schemas/_pagination' + Profile: + type: object + description: The "Profile" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + image: + oneOf: + - type: 'null' + - type: string + userId: + type: string + relationships: + type: object + properties: + user: + $ref: '#/components/schemas/_toOneRelationshipWithLinks' + ProfileCreateRequest: + type: object + description: Input for creating a "Profile" + required: + - data + properties: + data: + type: object + description: The "Profile" model + required: + - type + - attributes + properties: + type: + type: string + attributes: + type: object + required: + - userId + properties: + image: + oneOf: + - type: 'null' + - type: string + userId: + type: string + relationships: + type: object + properties: + user: + $ref: '#/components/schemas/_toOneRelationship' + meta: + $ref: '#/components/schemas/_meta' + ProfileUpdateRequest: + type: object + description: Input for updating a "Profile" + required: + - data + properties: + data: + type: object + description: The "Profile" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + image: + oneOf: + - type: 'null' + - type: string + userId: + type: string + relationships: + type: object + properties: + user: + $ref: '#/components/schemas/_toOneRelationship' + meta: + $ref: '#/components/schemas/_meta' + ProfileResponse: + type: object + description: Response for a "Profile" + required: + - data + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + data: + allOf: + - $ref: '#/components/schemas/Profile' + - type: object + properties: + relationships: + type: object + properties: &a2 + user: + $ref: '#/components/schemas/_toOneRelationship' + meta: + $ref: '#/components/schemas/_meta' + included: + type: array + items: + $ref: '#/components/schemas/_resource' + links: + $ref: '#/components/schemas/_links' + ProfileListResponse: + type: object + description: Response for a list of "Profile" + required: + - data + - links + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/Profile' + - type: object + properties: + relationships: + type: object + properties: *a2 + meta: + $ref: '#/components/schemas/_meta' + included: + type: array + items: + $ref: '#/components/schemas/_resource' + links: + allOf: + - $ref: '#/components/schemas/_links' + - $ref: '#/components/schemas/_pagination' post_Item: type: object description: The "post_Item" model @@ -1702,16 +2395,24 @@ components: title: type: string authorId: - type: string + oneOf: + - type: 'null' + - type: string published: type: boolean viewCount: type: integer + notes: + oneOf: + - type: 'null' + - type: string relationships: type: object properties: author: - $ref: '#/components/schemas/_toOneRelationshipWithLinks' + oneOf: + - type: 'null' + - $ref: '#/components/schemas/_toOneRelationshipWithLinks' post_ItemCreateRequest: type: object description: Input for creating a "post_Item" @@ -1745,16 +2446,24 @@ components: title: type: string authorId: - type: string + oneOf: + - type: 'null' + - type: string published: type: boolean viewCount: type: integer + notes: + oneOf: + - type: 'null' + - type: string relationships: type: object properties: author: - $ref: '#/components/schemas/_toOneRelationship' + oneOf: + - type: 'null' + - $ref: '#/components/schemas/_toOneRelationship' meta: $ref: '#/components/schemas/_meta' post_ItemUpdateRequest: @@ -1787,16 +2496,24 @@ components: title: type: string authorId: - type: string + oneOf: + - type: 'null' + - type: string published: type: boolean viewCount: type: integer + notes: + oneOf: + - type: 'null' + - type: string relationships: type: object properties: author: - $ref: '#/components/schemas/_toOneRelationship' + oneOf: + - type: 'null' + - $ref: '#/components/schemas/_toOneRelationship' meta: $ref: '#/components/schemas/_meta' post_ItemResponse: @@ -1814,7 +2531,7 @@ components: properties: relationships: type: object - properties: &a2 + properties: &a3 author: $ref: '#/components/schemas/_toOneRelationship' meta: @@ -1843,7 +2560,7 @@ components: properties: relationships: type: object - properties: *a2 + properties: *a3 meta: $ref: '#/components/schemas/_meta' included: diff --git a/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.0.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.0.0.baseline.yaml new file mode 100644 index 000000000..a20233b24 --- /dev/null +++ b/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.0.0.baseline.yaml @@ -0,0 +1,803 @@ +openapi: 3.0.0 +info: + title: ZenStack Generated API + version: 1.0.0 +tags: + - name: foo + description: Foo operations +paths: + /foo: + get: + operationId: list-Foo + description: List "Foo" resources + tags: + - foo + parameters: + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/page-offset' + - $ref: '#/components/parameters/page-limit' + - name: filter[id] + required: false + description: Id filter + in: query + style: form + explode: false + schema: + type: string + - name: filter[string] + required: false + description: Equality filter for "string" + in: query + style: form + explode: false + schema: + type: string + - name: filter[string$contains] + required: false + description: String contains filter for "string" + in: query + style: form + explode: false + schema: + type: string + - name: filter[string$icontains] + required: false + description: String case-insensitive contains filter for "string" + in: query + style: form + explode: false + schema: + type: string + - name: filter[string$search] + required: false + description: String full-text search filter for "string" + in: query + style: form + explode: false + schema: + type: string + - name: filter[string$startsWith] + required: false + description: String startsWith filter for "string" + in: query + style: form + explode: false + schema: + type: string + - name: filter[string$endsWith] + required: false + description: String endsWith filter for "string" + in: query + style: form + explode: false + schema: + type: string + - name: filter[int] + required: false + description: Equality filter for "int" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[int$lt] + required: false + description: Less-than filter for "int" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[int$lte] + required: false + description: Less-than or equal filter for "int" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[int$gt] + required: false + description: Greater-than filter for "int" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[int$gte] + required: false + description: Greater-than or equal filter for "int" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[bigInt] + required: false + description: Equality filter for "bigInt" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[bigInt$lt] + required: false + description: Less-than filter for "bigInt" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[bigInt$lte] + required: false + description: Less-than or equal filter for "bigInt" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[bigInt$gt] + required: false + description: Greater-than filter for "bigInt" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[bigInt$gte] + required: false + description: Greater-than or equal filter for "bigInt" + in: query + style: form + explode: false + schema: + type: integer + - name: filter[date] + required: false + description: Equality filter for "date" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[date$lt] + required: false + description: Less-than filter for "date" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[date$lte] + required: false + description: Less-than or equal filter for "date" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[date$gt] + required: false + description: Greater-than filter for "date" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[date$gte] + required: false + description: Greater-than or equal filter for "date" + in: query + style: form + explode: false + schema: + type: string + format: date-time + - name: filter[float] + required: false + description: Equality filter for "float" + in: query + style: form + explode: false + schema: + type: number + - name: filter[float$lt] + required: false + description: Less-than filter for "float" + in: query + style: form + explode: false + schema: + type: number + - name: filter[float$lte] + required: false + description: Less-than or equal filter for "float" + in: query + style: form + explode: false + schema: + type: number + - name: filter[float$gt] + required: false + description: Greater-than filter for "float" + in: query + style: form + explode: false + schema: + type: number + - name: filter[float$gte] + required: false + description: Greater-than or equal filter for "float" + in: query + style: form + explode: false + schema: + type: number + - name: filter[decimal] + required: false + description: Equality filter for "decimal" + in: query + style: form + explode: false + schema: + oneOf: + - type: number + - type: string + - name: filter[decimal$lt] + required: false + description: Less-than filter for "decimal" + in: query + style: form + explode: false + schema: + oneOf: + - type: number + - type: string + - name: filter[decimal$lte] + required: false + description: Less-than or equal filter for "decimal" + in: query + style: form + explode: false + schema: + oneOf: + - type: number + - type: string + - name: filter[decimal$gt] + required: false + description: Greater-than filter for "decimal" + in: query + style: form + explode: false + schema: + oneOf: + - type: number + - type: string + - name: filter[decimal$gte] + required: false + description: Greater-than or equal filter for "decimal" + in: query + style: form + explode: false + schema: + oneOf: + - type: number + - type: string + - name: filter[boolean] + required: false + description: Equality filter for "boolean" + in: query + style: form + explode: false + schema: + type: boolean + - name: filter[bytes] + required: false + description: Equality filter for "bytes" + in: query + style: form + explode: false + schema: + type: string + format: byte + description: Base64 encoded byte array + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/FooListResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + security: [] + post: + operationId: create-Foo + description: Create a "Foo" resource + tags: + - foo + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/FooCreateRequest' + responses: + '201': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/FooResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + security: [] + '/foo/{id}': + get: + operationId: fetch-Foo + description: Fetch a "Foo" resource + tags: + - foo + parameters: + - $ref: '#/components/parameters/id' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/FooResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + security: [] + put: + operationId: update-Foo-put + description: Update a "Foo" resource + tags: + - foo + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/FooUpdateRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/FooResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + security: [] + patch: + operationId: update-Foo-patch + description: Update a "Foo" resource + tags: + - foo + parameters: + - $ref: '#/components/parameters/id' + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/FooUpdateRequest' + responses: + '200': + description: Successful operation + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/FooResponse' + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + security: [] + delete: + operationId: delete-Foo + description: Delete a "Foo" resource + tags: + - foo + parameters: + - $ref: '#/components/parameters/id' + responses: + '200': + description: Successful operation + '403': + description: Request is forbidden + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + '404': + description: Resource is not found + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/_errorResponse' + security: [] +components: + schemas: + _jsonapi: + type: object + description: An object describing the server’s implementation + required: + - version + properties: + version: + type: string + _meta: + type: object + description: Meta information about the request or response + properties: + serialization: + description: Superjson serialization metadata + additionalProperties: true + _resourceIdentifier: + type: object + description: Identifier for a resource + required: + - type + - id + properties: + type: + type: string + description: Resource type + id: + type: string + description: Resource id + _resource: + allOf: + - $ref: '#/components/schemas/_resourceIdentifier' + - type: object + description: A resource with attributes and relationships + properties: + attributes: + type: object + description: Resource attributes + relationships: + type: object + description: Resource relationships + _links: + type: object + required: + - self + description: Links related to the resource + properties: + self: + type: string + description: Link for refetching the curent results + _pagination: + type: object + description: Pagination information + required: + - first + - last + - prev + - next + properties: + first: + type: string + description: Link to the first page + nullable: true + last: + type: string + description: Link to the last page + nullable: true + prev: + type: string + description: Link to the previous page + nullable: true + next: + type: string + description: Link to the next page + nullable: true + _errors: + type: array + description: An array of error objects + items: + type: object + required: + - status + - code + properties: + status: + type: string + description: HTTP status + code: + type: string + description: Error code + prismaCode: + type: string + description: Prisma error code if the error is thrown by Prisma + title: + type: string + description: Error title + detail: + type: string + description: Error detail + reason: + type: string + description: Detailed error reason + zodErrors: + type: object + additionalProperties: true + description: Zod validation errors if the error is due to data validation + failure + _errorResponse: + type: object + required: + - errors + description: An error response + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + errors: + $ref: '#/components/schemas/_errors' + Foo: + type: object + description: The "Foo" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + string: + type: string + int: + type: integer + bigInt: + type: integer + date: + type: string + format: date-time + float: + type: number + decimal: + oneOf: + - type: number + - type: string + boolean: + type: boolean + bytes: + type: string + format: byte + description: Base64 encoded byte array + FooCreateRequest: + type: object + description: Input for creating a "Foo" + required: + - data + properties: + data: + type: object + description: The "Foo" model + required: + - type + - attributes + properties: + type: + type: string + attributes: + type: object + required: + - string + - int + - bigInt + - date + - float + - decimal + - boolean + - bytes + properties: + string: + type: string + int: + type: integer + bigInt: + type: integer + date: + type: string + format: date-time + float: + type: number + decimal: + oneOf: + - type: number + - type: string + boolean: + type: boolean + bytes: + type: string + format: byte + description: Base64 encoded byte array + meta: + $ref: '#/components/schemas/_meta' + FooUpdateRequest: + type: object + description: Input for updating a "Foo" + required: + - data + properties: + data: + type: object + description: The "Foo" model + required: + - id + - type + - attributes + properties: + id: + type: string + type: + type: string + attributes: + type: object + properties: + string: + type: string + int: + type: integer + bigInt: + type: integer + date: + type: string + format: date-time + float: + type: number + decimal: + oneOf: + - type: number + - type: string + boolean: + type: boolean + bytes: + type: string + format: byte + description: Base64 encoded byte array + meta: + $ref: '#/components/schemas/_meta' + FooResponse: + type: object + description: Response for a "Foo" + required: + - data + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + data: + allOf: + - $ref: '#/components/schemas/Foo' + - type: object + properties: + relationships: + type: object + properties: &a1 {} + meta: + $ref: '#/components/schemas/_meta' + included: + type: array + items: + $ref: '#/components/schemas/_resource' + links: + $ref: '#/components/schemas/_links' + FooListResponse: + type: object + description: Response for a list of "Foo" + required: + - data + - links + properties: + jsonapi: + $ref: '#/components/schemas/_jsonapi' + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/Foo' + - type: object + properties: + relationships: + type: object + properties: *a1 + meta: + $ref: '#/components/schemas/_meta' + included: + type: array + items: + $ref: '#/components/schemas/_resource' + links: + allOf: + - $ref: '#/components/schemas/_links' + - $ref: '#/components/schemas/_pagination' + parameters: + id: + name: id + in: path + description: The resource id + required: true + schema: + type: string + include: + name: include + in: query + description: Relationships to include + required: false + style: form + schema: + type: string + sort: + name: sort + in: query + description: Fields to sort by + required: false + style: form + schema: + type: string + page-offset: + name: page[offset] + in: query + description: Offset for pagination + required: false + style: form + schema: + type: integer + page-limit: + name: page[limit] + in: query + description: Limit for pagination + required: false + style: form + schema: + type: integer diff --git a/packages/plugins/openapi/tests/baseline/rest-type-coverage.baseline.yaml b/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.1.0.baseline.yaml similarity index 100% rename from packages/plugins/openapi/tests/baseline/rest-type-coverage.baseline.yaml rename to packages/plugins/openapi/tests/baseline/rest-type-coverage-3.1.0.baseline.yaml index c37e16697..30b1dc4f6 100644 --- a/packages/plugins/openapi/tests/baseline/rest-type-coverage.baseline.yaml +++ b/packages/plugins/openapi/tests/baseline/rest-type-coverage-3.1.0.baseline.yaml @@ -522,24 +522,24 @@ components: properties: first: oneOf: + - type: 'null' - type: string description: Link to the first page - - type: 'null' last: oneOf: + - type: 'null' - type: string description: Link to the last page - - type: 'null' prev: oneOf: + - type: 'null' - type: string description: Link to the previous page - - type: 'null' next: oneOf: + - type: 'null' - type: string description: Link to the next page - - type: 'null' _errors: type: array description: An array of error objects diff --git a/packages/plugins/openapi/tests/baseline/rpc.baseline.yaml b/packages/plugins/openapi/tests/baseline/rpc-3.0.0.baseline.yaml similarity index 67% rename from packages/plugins/openapi/tests/baseline/rpc.baseline.yaml rename to packages/plugins/openapi/tests/baseline/rpc-3.0.0.baseline.yaml index 94d1445ce..0f936771e 100644 --- a/packages/plugins/openapi/tests/baseline/rpc.baseline.yaml +++ b/packages/plugins/openapi/tests/baseline/rpc-3.0.0.baseline.yaml @@ -1,10 +1,12 @@ -openapi: 3.1.0 +openapi: 3.0.0 info: title: ZenStack Generated API version: 1.0.0 tags: - name: user description: User operations + - name: profile + description: Profile operations - name: post_Item description: Post-related operations components: @@ -22,6 +24,12 @@ components: - updatedAt - email - role + ProfileScalarFieldEnum: + type: string + enum: + - id + - image + - userId Post_ItemScalarFieldEnum: type: string enum: @@ -32,6 +40,7 @@ components: - authorId - published - viewCount + - notes SortOrder: type: string enum: @@ -66,12 +75,32 @@ components: type: array items: $ref: '#/components/schemas/Post_Item' + profile: + allOf: + - $ref: '#/components/schemas/Profile' + nullable: true required: - id - createdAt - updatedAt - email - role + Profile: + type: object + properties: + id: + type: string + image: + type: string + nullable: true + user: + $ref: '#/components/schemas/User' + userId: + type: string + required: + - id + - user + - userId Post_Item: type: object properties: @@ -86,13 +115,19 @@ components: title: type: string author: - $ref: '#/components/schemas/User' + allOf: + - $ref: '#/components/schemas/User' + nullable: true authorId: type: string + nullable: true published: type: boolean viewCount: type: integer + notes: + type: string + nullable: true required: - id - createdAt @@ -143,6 +178,11 @@ components: - $ref: '#/components/schemas/Role' posts: $ref: '#/components/schemas/Post_ItemListRelationFilter' + profile: + oneOf: + - $ref: '#/components/schemas/ProfileRelationFilter' + - $ref: '#/components/schemas/ProfileWhereInput' + nullable: true UserOrderByWithRelationInput: type: object properties: @@ -158,6 +198,8 @@ components: $ref: '#/components/schemas/SortOrder' posts: $ref: '#/components/schemas/Post_ItemOrderByRelationAggregateInput' + profile: + $ref: '#/components/schemas/ProfileOrderByWithRelationInput' UserWhereUniqueInput: type: object properties: @@ -206,6 +248,94 @@ components: oneOf: - $ref: '#/components/schemas/EnumroleWithAggregatesFilter' - $ref: '#/components/schemas/Role' + ProfileWhereInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/ProfileWhereInput' + - type: array + items: + $ref: '#/components/schemas/ProfileWhereInput' + OR: + type: array + items: + $ref: '#/components/schemas/ProfileWhereInput' + NOT: + oneOf: + - $ref: '#/components/schemas/ProfileWhereInput' + - type: array + items: + $ref: '#/components/schemas/ProfileWhereInput' + id: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + image: + oneOf: + - $ref: '#/components/schemas/StringNullableFilter' + - type: string + nullable: true + userId: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + user: + oneOf: + - $ref: '#/components/schemas/UserRelationFilter' + - $ref: '#/components/schemas/UserWhereInput' + ProfileOrderByWithRelationInput: + type: object + properties: + id: + $ref: '#/components/schemas/SortOrder' + image: + oneOf: + - $ref: '#/components/schemas/SortOrder' + - $ref: '#/components/schemas/SortOrderInput' + userId: + $ref: '#/components/schemas/SortOrder' + user: + $ref: '#/components/schemas/UserOrderByWithRelationInput' + ProfileWhereUniqueInput: + type: object + properties: + id: + type: string + userId: + type: string + ProfileScalarWhereWithAggregatesInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + - type: array + items: + $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + OR: + type: array + items: + $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + NOT: + oneOf: + - $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + - type: array + items: + $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + id: + oneOf: + - $ref: '#/components/schemas/StringWithAggregatesFilter' + - type: string + image: + oneOf: + - $ref: '#/components/schemas/StringNullableWithAggregatesFilter' + - type: string + nullable: true + userId: + oneOf: + - $ref: '#/components/schemas/StringWithAggregatesFilter' + - type: string Post_ItemWhereInput: type: object properties: @@ -247,6 +377,7 @@ components: oneOf: - $ref: '#/components/schemas/StringNullableFilter' - type: string + nullable: true published: oneOf: - $ref: '#/components/schemas/BoolFilter' @@ -255,10 +386,16 @@ components: oneOf: - $ref: '#/components/schemas/IntFilter' - type: integer + notes: + oneOf: + - $ref: '#/components/schemas/StringNullableFilter' + - type: string + nullable: true author: oneOf: - $ref: '#/components/schemas/UserRelationFilter' - $ref: '#/components/schemas/UserWhereInput' + nullable: true Post_ItemOrderByWithRelationInput: type: object properties: @@ -278,6 +415,10 @@ components: $ref: '#/components/schemas/SortOrder' viewCount: $ref: '#/components/schemas/SortOrder' + notes: + oneOf: + - $ref: '#/components/schemas/SortOrder' + - $ref: '#/components/schemas/SortOrderInput' author: $ref: '#/components/schemas/UserOrderByWithRelationInput' Post_ItemWhereUniqueInput: @@ -326,6 +467,7 @@ components: oneOf: - $ref: '#/components/schemas/StringNullableWithAggregatesFilter' - type: string + nullable: true published: oneOf: - $ref: '#/components/schemas/BoolWithAggregatesFilter' @@ -334,6 +476,11 @@ components: oneOf: - $ref: '#/components/schemas/IntWithAggregatesFilter' - type: integer + notes: + oneOf: + - $ref: '#/components/schemas/StringNullableWithAggregatesFilter' + - type: string + nullable: true UserCreateInput: type: object properties: @@ -351,6 +498,8 @@ components: $ref: '#/components/schemas/Role' posts: $ref: '#/components/schemas/Post_ItemCreateNestedManyWithoutAuthorInput' + profile: + $ref: '#/components/schemas/ProfileCreateNestedOneWithoutUserInput' required: - email UserUpdateInput: @@ -380,6 +529,8 @@ components: - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' posts: $ref: '#/components/schemas/Post_ItemUpdateManyWithoutAuthorNestedInput' + profile: + $ref: '#/components/schemas/ProfileUpdateOneWithoutUserNestedInput' UserCreateManyInput: type: object properties: @@ -422,6 +573,56 @@ components: oneOf: - $ref: '#/components/schemas/Role' - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' + ProfileCreateInput: + type: object + properties: + id: + type: string + image: + type: string + nullable: true + user: + $ref: '#/components/schemas/UserCreateNestedOneWithoutProfileInput' + required: + - user + ProfileUpdateInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + image: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + nullable: true + user: + $ref: '#/components/schemas/UserUpdateOneRequiredWithoutProfileNestedInput' + ProfileCreateManyInput: + type: object + properties: + id: + type: string + image: + type: string + nullable: true + userId: + type: string + required: + - userId + ProfileUpdateManyMutationInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + image: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + nullable: true Post_ItemCreateInput: type: object properties: @@ -439,6 +640,9 @@ components: type: boolean viewCount: type: integer + notes: + type: string + nullable: true author: $ref: '#/components/schemas/UserCreateNestedOneWithoutPostsInput' required: @@ -473,6 +677,11 @@ components: oneOf: - type: integer - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + notes: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + nullable: true author: $ref: '#/components/schemas/UserUpdateOneWithoutPostsNestedInput' Post_ItemCreateManyInput: @@ -490,10 +699,14 @@ components: type: string authorId: type: string + nullable: true published: type: boolean viewCount: type: integer + notes: + type: string + nullable: true required: - id - title @@ -526,6 +739,11 @@ components: oneOf: - type: integer - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + notes: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + nullable: true StringFilter: type: object properties: @@ -632,6 +850,17 @@ components: $ref: '#/components/schemas/Post_ItemWhereInput' none: $ref: '#/components/schemas/Post_ItemWhereInput' + ProfileRelationFilter: + type: object + properties: + is: + allOf: + - $ref: '#/components/schemas/ProfileWhereInput' + nullable: true + isNot: + allOf: + - $ref: '#/components/schemas/ProfileWhereInput' + nullable: true Post_ItemOrderByRelationAggregateInput: type: object properties: @@ -757,18 +986,21 @@ components: properties: equals: type: string + nullable: true in: oneOf: - type: array items: type: string - type: string + nullable: true notIn: oneOf: - type: array items: type: string - type: string + nullable: true lt: type: string lte: @@ -789,51 +1021,18 @@ components: oneOf: - type: string - $ref: '#/components/schemas/NestedStringNullableFilter' - BoolFilter: - type: object - properties: - equals: - type: boolean - not: - oneOf: - - type: boolean - - $ref: '#/components/schemas/NestedBoolFilter' - IntFilter: - type: object - properties: - equals: - type: integer - in: - oneOf: - - type: array - items: - type: integer - - type: integer - notIn: - oneOf: - - type: array - items: - type: integer - - type: integer - lt: - type: integer - lte: - type: integer - gt: - type: integer - gte: - type: integer - not: - oneOf: - - type: integer - - $ref: '#/components/schemas/NestedIntFilter' + nullable: true UserRelationFilter: type: object properties: is: - $ref: '#/components/schemas/UserWhereInput' + allOf: + - $ref: '#/components/schemas/UserWhereInput' + nullable: true isNot: - $ref: '#/components/schemas/UserWhereInput' + allOf: + - $ref: '#/components/schemas/UserWhereInput' + nullable: true SortOrderInput: type: object properties: @@ -848,18 +1047,21 @@ components: properties: equals: type: string + nullable: true in: oneOf: - type: array items: type: string - type: string + nullable: true notIn: oneOf: - type: array items: type: string - type: string + nullable: true lt: type: string lte: @@ -880,12 +1082,51 @@ components: oneOf: - type: string - $ref: '#/components/schemas/NestedStringNullableWithAggregatesFilter' + nullable: true _count: $ref: '#/components/schemas/NestedIntNullableFilter' _min: $ref: '#/components/schemas/NestedStringNullableFilter' _max: $ref: '#/components/schemas/NestedStringNullableFilter' + BoolFilter: + type: object + properties: + equals: + type: boolean + not: + oneOf: + - type: boolean + - $ref: '#/components/schemas/NestedBoolFilter' + IntFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntFilter' BoolWithAggregatesFilter: type: object properties: @@ -967,6 +1208,55 @@ components: - type: array items: $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + ProfileCreateNestedOneWithoutUserInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + connectOrCreate: + $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput' + connect: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + Post_ItemUncheckedCreateNestedManyWithoutAuthorInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + connectOrCreate: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + createMany: + $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope' + connect: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + ProfileUncheckedCreateNestedOneWithoutUserInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + connectOrCreate: + $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput' + connect: + $ref: '#/components/schemas/ProfileWhereUniqueInput' StringFieldUpdateOperationsInput: type: object properties: @@ -1052,17 +1342,162 @@ components: - type: array items: $ref: '#/components/schemas/Post_ItemScalarWhereInput' - UserCreateNestedOneWithoutPostsInput: + ProfileUpdateOneWithoutUserNestedInput: type: object properties: create: oneOf: - - $ref: '#/components/schemas/UserCreateWithoutPostsInput' - - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput' + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' connectOrCreate: - $ref: '#/components/schemas/UserCreateOrConnectWithoutPostsInput' + $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput' + upsert: + $ref: '#/components/schemas/ProfileUpsertWithoutUserInput' + disconnect: + type: boolean + delete: + type: boolean connect: - $ref: '#/components/schemas/UserWhereUniqueInput' + $ref: '#/components/schemas/ProfileWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput' + Post_ItemUncheckedUpdateManyWithoutAuthorNestedInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + connectOrCreate: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + upsert: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput' + createMany: + $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope' + set: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + disconnect: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + delete: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + connect: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput' + updateMany: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput' + deleteMany: + oneOf: + - $ref: '#/components/schemas/Post_ItemScalarWhereInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemScalarWhereInput' + ProfileUncheckedUpdateOneWithoutUserNestedInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + connectOrCreate: + $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput' + upsert: + $ref: '#/components/schemas/ProfileUpsertWithoutUserInput' + disconnect: + type: boolean + delete: + type: boolean + connect: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput' + UserCreateNestedOneWithoutProfileInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput' + connectOrCreate: + $ref: '#/components/schemas/UserCreateOrConnectWithoutProfileInput' + connect: + $ref: '#/components/schemas/UserWhereUniqueInput' + NullableStringFieldUpdateOperationsInput: + type: object + properties: + set: + type: string + nullable: true + UserUpdateOneRequiredWithoutProfileNestedInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput' + connectOrCreate: + $ref: '#/components/schemas/UserCreateOrConnectWithoutProfileInput' + upsert: + $ref: '#/components/schemas/UserUpsertWithoutProfileInput' + connect: + $ref: '#/components/schemas/UserWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/UserUpdateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedUpdateWithoutProfileInput' + UserCreateNestedOneWithoutPostsInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutPostsInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput' + connectOrCreate: + $ref: '#/components/schemas/UserCreateOrConnectWithoutPostsInput' + connect: + $ref: '#/components/schemas/UserWhereUniqueInput' BoolFieldUpdateOperationsInput: type: object properties: @@ -1344,18 +1779,21 @@ components: properties: equals: type: string + nullable: true in: oneOf: - type: array items: type: string - type: string + nullable: true notIn: oneOf: - type: array items: type: string - type: string + nullable: true lt: type: string lte: @@ -1374,32 +1812,27 @@ components: oneOf: - type: string - $ref: '#/components/schemas/NestedStringNullableFilter' - NestedBoolFilter: - type: object - properties: - equals: - type: boolean - not: - oneOf: - - type: boolean - - $ref: '#/components/schemas/NestedBoolFilter' + nullable: true NestedStringNullableWithAggregatesFilter: type: object properties: equals: type: string + nullable: true in: oneOf: - type: array items: type: string - type: string + nullable: true notIn: oneOf: - type: array items: type: string - type: string + nullable: true lt: type: string lte: @@ -1418,6 +1851,7 @@ components: oneOf: - type: string - $ref: '#/components/schemas/NestedStringNullableWithAggregatesFilter' + nullable: true _count: $ref: '#/components/schemas/NestedIntNullableFilter' _min: @@ -1429,18 +1863,21 @@ components: properties: equals: type: integer + nullable: true in: oneOf: - type: array items: type: integer - type: integer + nullable: true notIn: oneOf: - type: array items: type: integer - type: integer + nullable: true lt: type: integer lte: @@ -1453,6 +1890,16 @@ components: oneOf: - type: integer - $ref: '#/components/schemas/NestedIntNullableFilter' + nullable: true + NestedBoolFilter: + type: object + properties: + equals: + type: boolean + not: + oneOf: + - type: boolean + - $ref: '#/components/schemas/NestedBoolFilter' NestedBoolWithAggregatesFilter: type: object properties: @@ -1553,6 +2000,9 @@ components: type: boolean viewCount: type: integer + notes: + type: string + nullable: true required: - id - title @@ -1573,6 +2023,9 @@ components: type: boolean viewCount: type: integer + notes: + type: string + nullable: true required: - id - title @@ -1601,6 +2054,34 @@ components: type: boolean required: - data + ProfileCreateWithoutUserInput: + type: object + properties: + id: + type: string + image: + type: string + nullable: true + ProfileUncheckedCreateWithoutUserInput: + type: object + properties: + id: + type: string + image: + type: string + nullable: true + ProfileCreateOrConnectWithoutUserInput: + type: object + properties: + where: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + required: + - where + - create Post_ItemUpsertWithWhereUniqueWithoutAuthorInput: type: object properties: @@ -1683,6 +2164,7 @@ components: oneOf: - $ref: '#/components/schemas/StringNullableFilter' - type: string + nullable: true published: oneOf: - $ref: '#/components/schemas/BoolFilter' @@ -1691,7 +2173,50 @@ components: oneOf: - $ref: '#/components/schemas/IntFilter' - type: integer - UserCreateWithoutPostsInput: + notes: + oneOf: + - $ref: '#/components/schemas/StringNullableFilter' + - type: string + nullable: true + ProfileUpsertWithoutUserInput: + type: object + properties: + update: + oneOf: + - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput' + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + required: + - update + - create + ProfileUpdateWithoutUserInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + image: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + nullable: true + ProfileUncheckedUpdateWithoutUserInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + image: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + nullable: true + UserCreateWithoutProfileInput: type: object properties: id: @@ -1706,9 +2231,11 @@ components: type: string role: $ref: '#/components/schemas/Role' + posts: + $ref: '#/components/schemas/Post_ItemCreateNestedManyWithoutAuthorInput' required: - email - UserUncheckedCreateWithoutPostsInput: + UserUncheckedCreateWithoutProfileInput: type: object properties: id: @@ -1723,35 +2250,38 @@ components: type: string role: $ref: '#/components/schemas/Role' + posts: + $ref: "#/components/schemas/Post_ItemUncheckedCreateNestedManyWithoutAuthorInpu\ + t" required: - email - UserCreateOrConnectWithoutPostsInput: + UserCreateOrConnectWithoutProfileInput: type: object properties: where: $ref: '#/components/schemas/UserWhereUniqueInput' create: oneOf: - - $ref: '#/components/schemas/UserCreateWithoutPostsInput' - - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput' + - $ref: '#/components/schemas/UserCreateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput' required: - where - create - UserUpsertWithoutPostsInput: + UserUpsertWithoutProfileInput: type: object properties: update: oneOf: - - $ref: '#/components/schemas/UserUpdateWithoutPostsInput' - - $ref: '#/components/schemas/UserUncheckedUpdateWithoutPostsInput' + - $ref: '#/components/schemas/UserUpdateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedUpdateWithoutProfileInput' create: oneOf: - - $ref: '#/components/schemas/UserCreateWithoutPostsInput' - - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput' + - $ref: '#/components/schemas/UserCreateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput' required: - update - create - UserUpdateWithoutPostsInput: + UserUpdateWithoutProfileInput: type: object properties: id: @@ -1776,7 +2306,9 @@ components: oneOf: - $ref: '#/components/schemas/Role' - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' - UserUncheckedUpdateWithoutPostsInput: + posts: + $ref: '#/components/schemas/Post_ItemUpdateManyWithoutAuthorNestedInput' + UserUncheckedUpdateWithoutProfileInput: type: object properties: id: @@ -1801,7 +2333,10 @@ components: oneOf: - $ref: '#/components/schemas/Role' - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' - Post_ItemCreateManyAuthorInput: + posts: + $ref: "#/components/schemas/Post_ItemUncheckedUpdateManyWithoutAuthorNestedInpu\ + t" + UserCreateWithoutPostsInput: type: object properties: id: @@ -1812,51 +2347,177 @@ components: updatedAt: type: string format: date-time - title: + email: type: string - published: - type: boolean - viewCount: - type: integer + role: + $ref: '#/components/schemas/Role' + profile: + $ref: '#/components/schemas/ProfileCreateNestedOneWithoutUserInput' required: - - id - - title - Post_ItemUpdateWithoutAuthorInput: + - email + UserUncheckedCreateWithoutPostsInput: type: object properties: id: - oneOf: - - type: string - - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + type: string createdAt: - oneOf: - - type: string - format: date-time - - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + type: string + format: date-time updatedAt: - oneOf: - - type: string - format: date-time - - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' - title: - oneOf: - - type: string - - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' - published: - oneOf: - - type: boolean - - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput' - viewCount: - oneOf: - - type: integer - - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' - Post_ItemUncheckedUpdateWithoutAuthorInput: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/Role' + profile: + $ref: '#/components/schemas/ProfileUncheckedCreateNestedOneWithoutUserInput' + required: + - email + UserCreateOrConnectWithoutPostsInput: type: object properties: - id: + where: + $ref: '#/components/schemas/UserWhereUniqueInput' + create: oneOf: - - type: string - - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + - $ref: '#/components/schemas/UserCreateWithoutPostsInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput' + required: + - where + - create + UserUpsertWithoutPostsInput: + type: object + properties: + update: + oneOf: + - $ref: '#/components/schemas/UserUpdateWithoutPostsInput' + - $ref: '#/components/schemas/UserUncheckedUpdateWithoutPostsInput' + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutPostsInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput' + required: + - update + - create + UserUpdateWithoutPostsInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + email: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + role: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' + profile: + $ref: '#/components/schemas/ProfileUpdateOneWithoutUserNestedInput' + UserUncheckedUpdateWithoutPostsInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + email: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + role: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' + profile: + $ref: '#/components/schemas/ProfileUncheckedUpdateOneWithoutUserNestedInput' + Post_ItemCreateManyAuthorInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + published: + type: boolean + viewCount: + type: integer + notes: + type: string + nullable: true + required: + - id + - title + Post_ItemUpdateWithoutAuthorInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + title: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + published: + oneOf: + - type: boolean + - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput' + viewCount: + oneOf: + - type: integer + - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + notes: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + nullable: true + Post_ItemUncheckedUpdateWithoutAuthorInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' createdAt: oneOf: - type: string @@ -1879,6 +2540,11 @@ components: oneOf: - type: integer - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + notes: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + nullable: true Post_ItemUncheckedUpdateManyWithoutPostsInput: type: object properties: @@ -1908,6 +2574,11 @@ components: oneOf: - type: integer - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + notes: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + nullable: true UserArgs: type: object properties: @@ -1915,6 +2586,13 @@ components: $ref: '#/components/schemas/UserSelect' include: $ref: '#/components/schemas/UserInclude' + ProfileArgs: + type: object + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + include: + $ref: '#/components/schemas/ProfileInclude' UserInclude: type: object properties: @@ -1922,10 +2600,21 @@ components: oneOf: - type: boolean - $ref: '#/components/schemas/Post_ItemFindManyArgs' + profile: + oneOf: + - type: boolean + - $ref: '#/components/schemas/ProfileArgs' _count: oneOf: - type: boolean - $ref: '#/components/schemas/UserCountOutputTypeArgs' + ProfileInclude: + type: object + properties: + user: + oneOf: + - type: boolean + - $ref: '#/components/schemas/UserArgs' Post_ItemInclude: type: object properties: @@ -1960,10 +2649,27 @@ components: oneOf: - type: boolean - $ref: '#/components/schemas/Post_ItemFindManyArgs' + profile: + oneOf: + - type: boolean + - $ref: '#/components/schemas/ProfileArgs' _count: oneOf: - type: boolean - $ref: '#/components/schemas/UserCountOutputTypeArgs' + ProfileSelect: + type: object + properties: + id: + type: boolean + image: + type: boolean + user: + oneOf: + - type: boolean + - $ref: '#/components/schemas/UserArgs' + userId: + type: boolean Post_ItemSelect: type: object properties: @@ -1985,6 +2691,8 @@ components: type: boolean viewCount: type: boolean + notes: + type: boolean UserCountAggregateInput: type: object properties: @@ -2026,15 +2734,50 @@ components: type: boolean role: type: boolean + ProfileCountAggregateInput: + type: object + properties: + id: + type: boolean + image: + type: boolean + userId: + type: boolean + _all: + type: boolean + ProfileMinAggregateInput: + type: object + properties: + id: + type: boolean + image: + type: boolean + userId: + type: boolean + ProfileMaxAggregateInput: + type: object + properties: + id: + type: boolean + image: + type: boolean + userId: + type: boolean AggregateUser: type: object properties: _count: - $ref: '#/components/schemas/UserCountAggregateOutputType' + allOf: + - $ref: '#/components/schemas/UserCountAggregateOutputType' + nullable: true _min: - $ref: '#/components/schemas/UserMinAggregateOutputType' + allOf: + - $ref: '#/components/schemas/UserMinAggregateOutputType' + nullable: true _max: - $ref: '#/components/schemas/UserMaxAggregateOutputType' + allOf: + - $ref: '#/components/schemas/UserMaxAggregateOutputType' + nullable: true UserGroupByOutputType: type: object properties: @@ -2051,30 +2794,86 @@ components: role: $ref: '#/components/schemas/Role' _count: - $ref: '#/components/schemas/UserCountAggregateOutputType' + allOf: + - $ref: '#/components/schemas/UserCountAggregateOutputType' + nullable: true _min: - $ref: '#/components/schemas/UserMinAggregateOutputType' + allOf: + - $ref: '#/components/schemas/UserMinAggregateOutputType' + nullable: true _max: - $ref: '#/components/schemas/UserMaxAggregateOutputType' + allOf: + - $ref: '#/components/schemas/UserMaxAggregateOutputType' + nullable: true required: - id - createdAt - updatedAt - email - role + AggregateProfile: + type: object + properties: + _count: + allOf: + - $ref: '#/components/schemas/ProfileCountAggregateOutputType' + nullable: true + _min: + allOf: + - $ref: '#/components/schemas/ProfileMinAggregateOutputType' + nullable: true + _max: + allOf: + - $ref: '#/components/schemas/ProfileMaxAggregateOutputType' + nullable: true + ProfileGroupByOutputType: + type: object + properties: + id: + type: string + image: + type: string + nullable: true + userId: + type: string + _count: + allOf: + - $ref: '#/components/schemas/ProfileCountAggregateOutputType' + nullable: true + _min: + allOf: + - $ref: '#/components/schemas/ProfileMinAggregateOutputType' + nullable: true + _max: + allOf: + - $ref: '#/components/schemas/ProfileMaxAggregateOutputType' + nullable: true + required: + - id + - userId AggregatePost_Item: type: object properties: _count: - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType' + allOf: + - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType' + nullable: true _avg: - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType' + allOf: + - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType' + nullable: true _sum: - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType' + allOf: + - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType' + nullable: true _min: - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType' + allOf: + - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType' + nullable: true _max: - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType' + allOf: + - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType' + nullable: true Post_ItemGroupByOutputType: type: object properties: @@ -2090,20 +2889,34 @@ components: type: string authorId: type: string + nullable: true published: type: boolean viewCount: type: integer + notes: + type: string + nullable: true _count: - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType' + allOf: + - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType' + nullable: true _avg: - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType' + allOf: + - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType' + nullable: true _sum: - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType' + allOf: + - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType' + nullable: true _min: - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType' + allOf: + - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType' + nullable: true _max: - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType' + allOf: + - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType' + nullable: true required: - id - createdAt @@ -2138,31 +2951,83 @@ components: properties: id: type: string + nullable: true createdAt: type: string format: date-time + nullable: true updatedAt: type: string format: date-time + nullable: true email: type: string + nullable: true role: - $ref: '#/components/schemas/Role' + allOf: + - $ref: '#/components/schemas/Role' + nullable: true UserMaxAggregateOutputType: type: object properties: id: type: string + nullable: true createdAt: type: string format: date-time + nullable: true updatedAt: type: string format: date-time + nullable: true email: type: string + nullable: true role: - $ref: '#/components/schemas/Role' + allOf: + - $ref: '#/components/schemas/Role' + nullable: true + ProfileCountAggregateOutputType: + type: object + properties: + id: + type: integer + image: + type: integer + userId: + type: integer + _all: + type: integer + required: + - id + - image + - userId + - _all + ProfileMinAggregateOutputType: + type: object + properties: + id: + type: string + nullable: true + image: + type: string + nullable: true + userId: + type: string + nullable: true + ProfileMaxAggregateOutputType: + type: object + properties: + id: + type: string + nullable: true + image: + type: string + nullable: true + userId: + type: string + nullable: true Post_ItemCountAggregateOutputType: type: object properties: @@ -2180,6 +3045,8 @@ components: type: integer viewCount: type: integer + notes: + type: integer _all: type: integer required: @@ -2190,55 +3057,78 @@ components: - authorId - published - viewCount + - notes - _all Post_ItemAvgAggregateOutputType: type: object properties: viewCount: type: number + nullable: true Post_ItemSumAggregateOutputType: type: object properties: viewCount: type: integer + nullable: true Post_ItemMinAggregateOutputType: type: object properties: id: type: string + nullable: true createdAt: type: string format: date-time + nullable: true updatedAt: type: string format: date-time + nullable: true title: type: string + nullable: true authorId: type: string + nullable: true published: type: boolean + nullable: true viewCount: type: integer + nullable: true + notes: + type: string + nullable: true Post_ItemMaxAggregateOutputType: type: object properties: id: type: string + nullable: true createdAt: type: string format: date-time + nullable: true updatedAt: type: string format: date-time + nullable: true title: type: string + nullable: true authorId: type: string + nullable: true published: type: boolean + nullable: true viewCount: type: integer + nullable: true + notes: + type: string + nullable: true _Meta: type: object properties: @@ -2465,91 +3355,91 @@ components: $ref: '#/components/schemas/UserMaxAggregateInput' meta: $ref: '#/components/schemas/_Meta' - Post_ItemCreateArgs: + ProfileCreateArgs: type: object required: - data properties: select: - $ref: '#/components/schemas/Post_ItemSelect' + $ref: '#/components/schemas/ProfileSelect' include: - $ref: '#/components/schemas/Post_ItemInclude' + $ref: '#/components/schemas/ProfileInclude' data: - $ref: '#/components/schemas/Post_ItemCreateInput' + $ref: '#/components/schemas/ProfileCreateInput' meta: $ref: '#/components/schemas/_Meta' - Post_ItemCreateManyArgs: + ProfileCreateManyArgs: type: object required: - data properties: data: - $ref: '#/components/schemas/Post_ItemCreateManyInput' + $ref: '#/components/schemas/ProfileCreateManyInput' meta: $ref: '#/components/schemas/_Meta' - Post_ItemFindUniqueArgs: + ProfileFindUniqueArgs: type: object required: - where properties: select: - $ref: '#/components/schemas/Post_ItemSelect' + $ref: '#/components/schemas/ProfileSelect' include: - $ref: '#/components/schemas/Post_ItemInclude' + $ref: '#/components/schemas/ProfileInclude' where: - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + $ref: '#/components/schemas/ProfileWhereUniqueInput' meta: $ref: '#/components/schemas/_Meta' - Post_ItemFindFirstArgs: + ProfileFindFirstArgs: type: object properties: select: - $ref: '#/components/schemas/Post_ItemSelect' + $ref: '#/components/schemas/ProfileSelect' include: - $ref: '#/components/schemas/Post_ItemInclude' + $ref: '#/components/schemas/ProfileInclude' where: - $ref: '#/components/schemas/Post_ItemWhereInput' + $ref: '#/components/schemas/ProfileWhereInput' meta: $ref: '#/components/schemas/_Meta' - Post_ItemFindManyArgs: + ProfileFindManyArgs: type: object properties: select: - $ref: '#/components/schemas/Post_ItemSelect' + $ref: '#/components/schemas/ProfileSelect' include: - $ref: '#/components/schemas/Post_ItemInclude' + $ref: '#/components/schemas/ProfileInclude' where: - $ref: '#/components/schemas/Post_ItemWhereInput' + $ref: '#/components/schemas/ProfileWhereInput' meta: $ref: '#/components/schemas/_Meta' - Post_ItemUpdateArgs: + ProfileUpdateArgs: type: object required: - where - data properties: select: - $ref: '#/components/schemas/Post_ItemSelect' + $ref: '#/components/schemas/ProfileSelect' include: - $ref: '#/components/schemas/Post_ItemInclude' + $ref: '#/components/schemas/ProfileInclude' where: - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + $ref: '#/components/schemas/ProfileWhereUniqueInput' data: - $ref: '#/components/schemas/Post_ItemUpdateInput' + $ref: '#/components/schemas/ProfileUpdateInput' meta: $ref: '#/components/schemas/_Meta' - Post_ItemUpdateManyArgs: + ProfileUpdateManyArgs: type: object required: - data properties: where: - $ref: '#/components/schemas/Post_ItemWhereInput' + $ref: '#/components/schemas/ProfileWhereInput' data: - $ref: '#/components/schemas/Post_ItemUpdateManyMutationInput' + $ref: '#/components/schemas/ProfileUpdateManyMutationInput' meta: $ref: '#/components/schemas/_Meta' - Post_ItemUpsertArgs: + ProfileUpsertArgs: type: object required: - create @@ -2557,24 +3447,204 @@ components: - where properties: select: - $ref: '#/components/schemas/Post_ItemSelect' + $ref: '#/components/schemas/ProfileSelect' include: - $ref: '#/components/schemas/Post_ItemInclude' + $ref: '#/components/schemas/ProfileInclude' where: - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + $ref: '#/components/schemas/ProfileWhereUniqueInput' create: - $ref: '#/components/schemas/Post_ItemCreateInput' + $ref: '#/components/schemas/ProfileCreateInput' update: - $ref: '#/components/schemas/Post_ItemUpdateInput' + $ref: '#/components/schemas/ProfileUpdateInput' meta: $ref: '#/components/schemas/_Meta' - Post_ItemDeleteUniqueArgs: + ProfileDeleteUniqueArgs: type: object required: - where properties: select: - $ref: '#/components/schemas/Post_ItemSelect' + $ref: '#/components/schemas/ProfileSelect' + include: + $ref: '#/components/schemas/ProfileInclude' + where: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileDeleteManyArgs: + type: object + properties: + where: + $ref: '#/components/schemas/ProfileWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileCountArgs: + type: object + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + where: + $ref: '#/components/schemas/ProfileWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileAggregateArgs: + type: object + properties: + where: + $ref: '#/components/schemas/ProfileWhereInput' + orderBy: + $ref: '#/components/schemas/ProfileOrderByWithRelationInput' + cursor: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + take: + type: integer + skip: + type: integer + _count: + oneOf: + - type: boolean + - $ref: '#/components/schemas/ProfileCountAggregateInput' + _min: + $ref: '#/components/schemas/ProfileMinAggregateInput' + _max: + $ref: '#/components/schemas/ProfileMaxAggregateInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileGroupByArgs: + type: object + properties: + where: + $ref: '#/components/schemas/ProfileWhereInput' + orderBy: + $ref: '#/components/schemas/ProfileOrderByWithRelationInput' + by: + $ref: '#/components/schemas/ProfileScalarFieldEnum' + having: + $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + take: + type: integer + skip: + type: integer + _count: + oneOf: + - type: boolean + - $ref: '#/components/schemas/ProfileCountAggregateInput' + _min: + $ref: '#/components/schemas/ProfileMinAggregateInput' + _max: + $ref: '#/components/schemas/ProfileMaxAggregateInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemCreateArgs: + type: object + required: + - data + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + data: + $ref: '#/components/schemas/Post_ItemCreateInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemCreateManyArgs: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Post_ItemCreateManyInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemFindUniqueArgs: + type: object + required: + - where + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemFindFirstArgs: + type: object + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemFindManyArgs: + type: object + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemUpdateArgs: + type: object + required: + - where + - data + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + data: + $ref: '#/components/schemas/Post_ItemUpdateInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemUpdateManyArgs: + type: object + required: + - data + properties: + where: + $ref: '#/components/schemas/Post_ItemWhereInput' + data: + $ref: '#/components/schemas/Post_ItemUpdateManyMutationInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemUpsertArgs: + type: object + required: + - create + - update + - where + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + create: + $ref: '#/components/schemas/Post_ItemCreateInput' + update: + $ref: '#/components/schemas/Post_ItemUpdateInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemDeleteUniqueArgs: + type: object + required: + - where + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' include: $ref: '#/components/schemas/Post_ItemInclude' where: @@ -3216,6 +4286,599 @@ paths: content: application/json: schema: {} + /profile/create: + post: + operationId: createProfile + description: Create a new Profile + tags: + - profile + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileCreateArgs' + /profile/createMany: + post: + operationId: createManyProfile + description: Create several Profile + tags: + - profile + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileCreateManyArgs' + /profile/findUnique: + get: + operationId: findUniqueProfile + description: Find one unique Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileFindUniqueArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/findFirst: + get: + operationId: findFirstProfile + description: Find the first Profile matching the given condition + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileFindFirstArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/findMany: + get: + operationId: findManyProfile + description: Find a list of Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileFindManyArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/update: + patch: + operationId: updateProfile + description: Update a Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileUpdateArgs' + /profile/updateMany: + patch: + operationId: updateManyProfile + description: Update Profiles matching the given condition + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileUpdateManyArgs' + /profile/upsert: + post: + operationId: upsertProfile + description: Upsert a Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileUpsertArgs' + /profile/delete: + delete: + operationId: deleteProfile + description: Delete one unique Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileDeleteUniqueArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/deleteMany: + delete: + operationId: deleteManyProfile + description: Delete Profiles matching the given condition + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileDeleteManyArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/count: + get: + operationId: countProfile + description: Find a list of Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + oneOf: + - type: integer + - $ref: '#/components/schemas/ProfileCountAggregateOutputType' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileCountArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/aggregate: + get: + operationId: aggregateProfile + description: Aggregate Profiles + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/AggregateProfile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileAggregateArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/groupBy: + get: + operationId: groupByProfile + description: Group Profiles by fields + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/ProfileGroupByOutputType' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileGroupByArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} /post_Item/create: post: operationId: createPost_Item diff --git a/packages/plugins/openapi/tests/baseline/rpc-3.1.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rpc-3.1.0.baseline.yaml new file mode 100644 index 000000000..d842234ab --- /dev/null +++ b/packages/plugins/openapi/tests/baseline/rpc-3.1.0.baseline.yaml @@ -0,0 +1,5477 @@ +openapi: 3.1.0 +info: + title: ZenStack Generated API + version: 1.0.0 +tags: + - name: user + description: User operations + - name: profile + description: Profile operations + - name: post_Item + description: Post-related operations +components: + schemas: + Role: + type: string + enum: + - USER + - ADMIN + UserScalarFieldEnum: + type: string + enum: + - id + - createdAt + - updatedAt + - email + - role + ProfileScalarFieldEnum: + type: string + enum: + - id + - image + - userId + Post_ItemScalarFieldEnum: + type: string + enum: + - id + - createdAt + - updatedAt + - title + - authorId + - published + - viewCount + - notes + SortOrder: + type: string + enum: + - asc + - desc + QueryMode: + type: string + enum: + - default + - insensitive + NullsOrder: + type: string + enum: + - first + - last + User: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/Role' + posts: + type: array + items: + $ref: '#/components/schemas/Post_Item' + profile: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Profile' + required: + - id + - createdAt + - updatedAt + - email + - role + Profile: + type: object + properties: + id: + type: string + image: + oneOf: + - type: 'null' + - type: string + user: + $ref: '#/components/schemas/User' + userId: + type: string + required: + - id + - user + - userId + Post_Item: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + author: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/User' + authorId: + oneOf: + - type: 'null' + - type: string + published: + type: boolean + viewCount: + type: integer + notes: + oneOf: + - type: 'null' + - type: string + required: + - id + - createdAt + - updatedAt + - title + - published + - viewCount + UserWhereInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/UserWhereInput' + - type: array + items: + $ref: '#/components/schemas/UserWhereInput' + OR: + type: array + items: + $ref: '#/components/schemas/UserWhereInput' + NOT: + oneOf: + - $ref: '#/components/schemas/UserWhereInput' + - type: array + items: + $ref: '#/components/schemas/UserWhereInput' + id: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + createdAt: + oneOf: + - $ref: '#/components/schemas/DateTimeFilter' + - type: string + format: date-time + updatedAt: + oneOf: + - $ref: '#/components/schemas/DateTimeFilter' + - type: string + format: date-time + email: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + role: + oneOf: + - $ref: '#/components/schemas/EnumroleFilter' + - $ref: '#/components/schemas/Role' + posts: + $ref: '#/components/schemas/Post_ItemListRelationFilter' + profile: + oneOf: + - $ref: '#/components/schemas/ProfileRelationFilter' + - $ref: '#/components/schemas/ProfileWhereInput' + - type: 'null' + UserOrderByWithRelationInput: + type: object + properties: + id: + $ref: '#/components/schemas/SortOrder' + createdAt: + $ref: '#/components/schemas/SortOrder' + updatedAt: + $ref: '#/components/schemas/SortOrder' + email: + $ref: '#/components/schemas/SortOrder' + role: + $ref: '#/components/schemas/SortOrder' + posts: + $ref: '#/components/schemas/Post_ItemOrderByRelationAggregateInput' + profile: + $ref: '#/components/schemas/ProfileOrderByWithRelationInput' + UserWhereUniqueInput: + type: object + properties: + id: + type: string + email: + type: string + UserScalarWhereWithAggregatesInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput' + - type: array + items: + $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput' + OR: + type: array + items: + $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput' + NOT: + oneOf: + - $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput' + - type: array + items: + $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput' + id: + oneOf: + - $ref: '#/components/schemas/StringWithAggregatesFilter' + - type: string + createdAt: + oneOf: + - $ref: '#/components/schemas/DateTimeWithAggregatesFilter' + - type: string + format: date-time + updatedAt: + oneOf: + - $ref: '#/components/schemas/DateTimeWithAggregatesFilter' + - type: string + format: date-time + email: + oneOf: + - $ref: '#/components/schemas/StringWithAggregatesFilter' + - type: string + role: + oneOf: + - $ref: '#/components/schemas/EnumroleWithAggregatesFilter' + - $ref: '#/components/schemas/Role' + ProfileWhereInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/ProfileWhereInput' + - type: array + items: + $ref: '#/components/schemas/ProfileWhereInput' + OR: + type: array + items: + $ref: '#/components/schemas/ProfileWhereInput' + NOT: + oneOf: + - $ref: '#/components/schemas/ProfileWhereInput' + - type: array + items: + $ref: '#/components/schemas/ProfileWhereInput' + id: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + image: + oneOf: + - $ref: '#/components/schemas/StringNullableFilter' + - type: string + - type: 'null' + userId: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + user: + oneOf: + - $ref: '#/components/schemas/UserRelationFilter' + - $ref: '#/components/schemas/UserWhereInput' + ProfileOrderByWithRelationInput: + type: object + properties: + id: + $ref: '#/components/schemas/SortOrder' + image: + oneOf: + - $ref: '#/components/schemas/SortOrder' + - $ref: '#/components/schemas/SortOrderInput' + userId: + $ref: '#/components/schemas/SortOrder' + user: + $ref: '#/components/schemas/UserOrderByWithRelationInput' + ProfileWhereUniqueInput: + type: object + properties: + id: + type: string + userId: + type: string + ProfileScalarWhereWithAggregatesInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + - type: array + items: + $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + OR: + type: array + items: + $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + NOT: + oneOf: + - $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + - type: array + items: + $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + id: + oneOf: + - $ref: '#/components/schemas/StringWithAggregatesFilter' + - type: string + image: + oneOf: + - $ref: '#/components/schemas/StringNullableWithAggregatesFilter' + - type: string + - type: 'null' + userId: + oneOf: + - $ref: '#/components/schemas/StringWithAggregatesFilter' + - type: string + Post_ItemWhereInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereInput' + OR: + type: array + items: + $ref: '#/components/schemas/Post_ItemWhereInput' + NOT: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereInput' + id: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + createdAt: + oneOf: + - $ref: '#/components/schemas/DateTimeFilter' + - type: string + format: date-time + updatedAt: + oneOf: + - $ref: '#/components/schemas/DateTimeFilter' + - type: string + format: date-time + title: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + authorId: + oneOf: + - $ref: '#/components/schemas/StringNullableFilter' + - type: string + - type: 'null' + published: + oneOf: + - $ref: '#/components/schemas/BoolFilter' + - type: boolean + viewCount: + oneOf: + - $ref: '#/components/schemas/IntFilter' + - type: integer + notes: + oneOf: + - $ref: '#/components/schemas/StringNullableFilter' + - type: string + - type: 'null' + author: + oneOf: + - $ref: '#/components/schemas/UserRelationFilter' + - $ref: '#/components/schemas/UserWhereInput' + - type: 'null' + Post_ItemOrderByWithRelationInput: + type: object + properties: + id: + $ref: '#/components/schemas/SortOrder' + createdAt: + $ref: '#/components/schemas/SortOrder' + updatedAt: + $ref: '#/components/schemas/SortOrder' + title: + $ref: '#/components/schemas/SortOrder' + authorId: + oneOf: + - $ref: '#/components/schemas/SortOrder' + - $ref: '#/components/schemas/SortOrderInput' + published: + $ref: '#/components/schemas/SortOrder' + viewCount: + $ref: '#/components/schemas/SortOrder' + notes: + oneOf: + - $ref: '#/components/schemas/SortOrder' + - $ref: '#/components/schemas/SortOrderInput' + author: + $ref: '#/components/schemas/UserOrderByWithRelationInput' + Post_ItemWhereUniqueInput: + type: object + properties: + id: + type: string + Post_ItemScalarWhereWithAggregatesInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput' + OR: + type: array + items: + $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput' + NOT: + oneOf: + - $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput' + id: + oneOf: + - $ref: '#/components/schemas/StringWithAggregatesFilter' + - type: string + createdAt: + oneOf: + - $ref: '#/components/schemas/DateTimeWithAggregatesFilter' + - type: string + format: date-time + updatedAt: + oneOf: + - $ref: '#/components/schemas/DateTimeWithAggregatesFilter' + - type: string + format: date-time + title: + oneOf: + - $ref: '#/components/schemas/StringWithAggregatesFilter' + - type: string + authorId: + oneOf: + - $ref: '#/components/schemas/StringNullableWithAggregatesFilter' + - type: string + - type: 'null' + published: + oneOf: + - $ref: '#/components/schemas/BoolWithAggregatesFilter' + - type: boolean + viewCount: + oneOf: + - $ref: '#/components/schemas/IntWithAggregatesFilter' + - type: integer + notes: + oneOf: + - $ref: '#/components/schemas/StringNullableWithAggregatesFilter' + - type: string + - type: 'null' + UserCreateInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/Role' + posts: + $ref: '#/components/schemas/Post_ItemCreateNestedManyWithoutAuthorInput' + profile: + $ref: '#/components/schemas/ProfileCreateNestedOneWithoutUserInput' + required: + - email + UserUpdateInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + email: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + role: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' + posts: + $ref: '#/components/schemas/Post_ItemUpdateManyWithoutAuthorNestedInput' + profile: + $ref: '#/components/schemas/ProfileUpdateOneWithoutUserNestedInput' + UserCreateManyInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/Role' + required: + - email + UserUpdateManyMutationInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + email: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + role: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' + ProfileCreateInput: + type: object + properties: + id: + type: string + image: + oneOf: + - type: 'null' + - type: string + user: + $ref: '#/components/schemas/UserCreateNestedOneWithoutProfileInput' + required: + - user + ProfileUpdateInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + image: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + - type: 'null' + user: + $ref: '#/components/schemas/UserUpdateOneRequiredWithoutProfileNestedInput' + ProfileCreateManyInput: + type: object + properties: + id: + type: string + image: + oneOf: + - type: 'null' + - type: string + userId: + type: string + required: + - userId + ProfileUpdateManyMutationInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + image: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + - type: 'null' + Post_ItemCreateInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + published: + type: boolean + viewCount: + type: integer + notes: + oneOf: + - type: 'null' + - type: string + author: + $ref: '#/components/schemas/UserCreateNestedOneWithoutPostsInput' + required: + - id + - title + Post_ItemUpdateInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + title: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + published: + oneOf: + - type: boolean + - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput' + viewCount: + oneOf: + - type: integer + - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + notes: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + - type: 'null' + author: + $ref: '#/components/schemas/UserUpdateOneWithoutPostsNestedInput' + Post_ItemCreateManyInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + authorId: + oneOf: + - type: 'null' + - type: string + published: + type: boolean + viewCount: + type: integer + notes: + oneOf: + - type: 'null' + - type: string + required: + - id + - title + Post_ItemUpdateManyMutationInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + title: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + published: + oneOf: + - type: boolean + - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput' + viewCount: + oneOf: + - type: integer + - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + notes: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + - type: 'null' + StringFilter: + type: object + properties: + equals: + type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + notIn: + oneOf: + - type: array + items: + type: string + - type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + mode: + $ref: '#/components/schemas/QueryMode' + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringFilter' + DateTimeFilter: + type: object + properties: + equals: + type: string + format: date-time + in: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + notIn: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + lt: + type: string + format: date-time + lte: + type: string + format: date-time + gt: + type: string + format: date-time + gte: + type: string + format: date-time + not: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/NestedDateTimeFilter' + EnumroleFilter: + type: object + properties: + equals: + $ref: '#/components/schemas/Role' + in: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/Role' + notIn: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/Role' + not: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/NestedEnumroleFilter' + Post_ItemListRelationFilter: + type: object + properties: + every: + $ref: '#/components/schemas/Post_ItemWhereInput' + some: + $ref: '#/components/schemas/Post_ItemWhereInput' + none: + $ref: '#/components/schemas/Post_ItemWhereInput' + ProfileRelationFilter: + type: object + properties: + is: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/ProfileWhereInput' + isNot: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/ProfileWhereInput' + Post_ItemOrderByRelationAggregateInput: + type: object + properties: + _count: + $ref: '#/components/schemas/SortOrder' + StringWithAggregatesFilter: + type: object + properties: + equals: + type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + notIn: + oneOf: + - type: array + items: + type: string + - type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + mode: + $ref: '#/components/schemas/QueryMode' + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedStringFilter' + _max: + $ref: '#/components/schemas/NestedStringFilter' + DateTimeWithAggregatesFilter: + type: object + properties: + equals: + type: string + format: date-time + in: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + notIn: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + lt: + type: string + format: date-time + lte: + type: string + format: date-time + gt: + type: string + format: date-time + gte: + type: string + format: date-time + not: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedDateTimeFilter' + _max: + $ref: '#/components/schemas/NestedDateTimeFilter' + EnumroleWithAggregatesFilter: + type: object + properties: + equals: + $ref: '#/components/schemas/Role' + in: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/Role' + notIn: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/Role' + not: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/NestedEnumroleWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedEnumroleFilter' + _max: + $ref: '#/components/schemas/NestedEnumroleFilter' + StringNullableFilter: + type: object + properties: + equals: + oneOf: + - type: 'null' + - type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + - type: 'null' + notIn: + oneOf: + - type: array + items: + type: string + - type: string + - type: 'null' + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + mode: + $ref: '#/components/schemas/QueryMode' + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringNullableFilter' + - type: 'null' + UserRelationFilter: + type: object + properties: + is: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/UserWhereInput' + isNot: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/UserWhereInput' + SortOrderInput: + type: object + properties: + sort: + $ref: '#/components/schemas/SortOrder' + nulls: + $ref: '#/components/schemas/NullsOrder' + required: + - sort + StringNullableWithAggregatesFilter: + type: object + properties: + equals: + oneOf: + - type: 'null' + - type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + - type: 'null' + notIn: + oneOf: + - type: array + items: + type: string + - type: string + - type: 'null' + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + mode: + $ref: '#/components/schemas/QueryMode' + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringNullableWithAggregatesFilter' + - type: 'null' + _count: + $ref: '#/components/schemas/NestedIntNullableFilter' + _min: + $ref: '#/components/schemas/NestedStringNullableFilter' + _max: + $ref: '#/components/schemas/NestedStringNullableFilter' + BoolFilter: + type: object + properties: + equals: + type: boolean + not: + oneOf: + - type: boolean + - $ref: '#/components/schemas/NestedBoolFilter' + IntFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntFilter' + BoolWithAggregatesFilter: + type: object + properties: + equals: + type: boolean + not: + oneOf: + - type: boolean + - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedBoolFilter' + _max: + $ref: '#/components/schemas/NestedBoolFilter' + IntWithAggregatesFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _avg: + $ref: '#/components/schemas/NestedFloatFilter' + _sum: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedIntFilter' + _max: + $ref: '#/components/schemas/NestedIntFilter' + Post_ItemCreateNestedManyWithoutAuthorInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + connectOrCreate: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + createMany: + $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope' + connect: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + ProfileCreateNestedOneWithoutUserInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + connectOrCreate: + $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput' + connect: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + Post_ItemUncheckedCreateNestedManyWithoutAuthorInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + connectOrCreate: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + createMany: + $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope' + connect: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + ProfileUncheckedCreateNestedOneWithoutUserInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + connectOrCreate: + $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput' + connect: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + StringFieldUpdateOperationsInput: + type: object + properties: + set: + type: string + DateTimeFieldUpdateOperationsInput: + type: object + properties: + set: + type: string + format: date-time + EnumroleFieldUpdateOperationsInput: + type: object + properties: + set: + $ref: '#/components/schemas/Role' + Post_ItemUpdateManyWithoutAuthorNestedInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + connectOrCreate: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + upsert: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput' + createMany: + $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope' + set: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + disconnect: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + delete: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + connect: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput' + updateMany: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput' + deleteMany: + oneOf: + - $ref: '#/components/schemas/Post_ItemScalarWhereInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemScalarWhereInput' + ProfileUpdateOneWithoutUserNestedInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + connectOrCreate: + $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput' + upsert: + $ref: '#/components/schemas/ProfileUpsertWithoutUserInput' + disconnect: + type: boolean + delete: + type: boolean + connect: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput' + Post_ItemUncheckedUpdateManyWithoutAuthorNestedInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + connectOrCreate: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateOrConnectWithoutAuthorInput' + upsert: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUpsertWithWhereUniqueWithoutAuthorInput' + createMany: + $ref: '#/components/schemas/Post_ItemCreateManyAuthorInputEnvelope' + set: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + disconnect: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + delete: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + connect: + oneOf: + - $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUpdateWithWhereUniqueWithoutAuthorInput' + updateMany: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemUpdateManyWithWhereWithoutAuthorInput' + deleteMany: + oneOf: + - $ref: '#/components/schemas/Post_ItemScalarWhereInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemScalarWhereInput' + ProfileUncheckedUpdateOneWithoutUserNestedInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + connectOrCreate: + $ref: '#/components/schemas/ProfileCreateOrConnectWithoutUserInput' + upsert: + $ref: '#/components/schemas/ProfileUpsertWithoutUserInput' + disconnect: + type: boolean + delete: + type: boolean + connect: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput' + UserCreateNestedOneWithoutProfileInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput' + connectOrCreate: + $ref: '#/components/schemas/UserCreateOrConnectWithoutProfileInput' + connect: + $ref: '#/components/schemas/UserWhereUniqueInput' + NullableStringFieldUpdateOperationsInput: + type: object + properties: + set: + oneOf: + - type: 'null' + - type: string + UserUpdateOneRequiredWithoutProfileNestedInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput' + connectOrCreate: + $ref: '#/components/schemas/UserCreateOrConnectWithoutProfileInput' + upsert: + $ref: '#/components/schemas/UserUpsertWithoutProfileInput' + connect: + $ref: '#/components/schemas/UserWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/UserUpdateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedUpdateWithoutProfileInput' + UserCreateNestedOneWithoutPostsInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutPostsInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput' + connectOrCreate: + $ref: '#/components/schemas/UserCreateOrConnectWithoutPostsInput' + connect: + $ref: '#/components/schemas/UserWhereUniqueInput' + BoolFieldUpdateOperationsInput: + type: object + properties: + set: + type: boolean + IntFieldUpdateOperationsInput: + type: object + properties: + set: + type: integer + increment: + type: integer + decrement: + type: integer + multiply: + type: integer + divide: + type: integer + UserUpdateOneWithoutPostsNestedInput: + type: object + properties: + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutPostsInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput' + connectOrCreate: + $ref: '#/components/schemas/UserCreateOrConnectWithoutPostsInput' + upsert: + $ref: '#/components/schemas/UserUpsertWithoutPostsInput' + disconnect: + type: boolean + delete: + type: boolean + connect: + $ref: '#/components/schemas/UserWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/UserUpdateWithoutPostsInput' + - $ref: '#/components/schemas/UserUncheckedUpdateWithoutPostsInput' + NestedStringFilter: + type: object + properties: + equals: + type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + notIn: + oneOf: + - type: array + items: + type: string + - type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringFilter' + NestedDateTimeFilter: + type: object + properties: + equals: + type: string + format: date-time + in: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + notIn: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + lt: + type: string + format: date-time + lte: + type: string + format: date-time + gt: + type: string + format: date-time + gte: + type: string + format: date-time + not: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/NestedDateTimeFilter' + NestedEnumroleFilter: + type: object + properties: + equals: + $ref: '#/components/schemas/Role' + in: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/Role' + notIn: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/Role' + not: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/NestedEnumroleFilter' + NestedStringWithAggregatesFilter: + type: object + properties: + equals: + type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + notIn: + oneOf: + - type: array + items: + type: string + - type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedStringFilter' + _max: + $ref: '#/components/schemas/NestedStringFilter' + NestedIntFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntFilter' + NestedDateTimeWithAggregatesFilter: + type: object + properties: + equals: + type: string + format: date-time + in: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + notIn: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + lt: + type: string + format: date-time + lte: + type: string + format: date-time + gt: + type: string + format: date-time + gte: + type: string + format: date-time + not: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedDateTimeFilter' + _max: + $ref: '#/components/schemas/NestedDateTimeFilter' + NestedEnumroleWithAggregatesFilter: + type: object + properties: + equals: + $ref: '#/components/schemas/Role' + in: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/Role' + notIn: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/Role' + not: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/NestedEnumroleWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedEnumroleFilter' + _max: + $ref: '#/components/schemas/NestedEnumroleFilter' + NestedStringNullableFilter: + type: object + properties: + equals: + oneOf: + - type: 'null' + - type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + - type: 'null' + notIn: + oneOf: + - type: array + items: + type: string + - type: string + - type: 'null' + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringNullableFilter' + - type: 'null' + NestedStringNullableWithAggregatesFilter: + type: object + properties: + equals: + oneOf: + - type: 'null' + - type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + - type: 'null' + notIn: + oneOf: + - type: array + items: + type: string + - type: string + - type: 'null' + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringNullableWithAggregatesFilter' + - type: 'null' + _count: + $ref: '#/components/schemas/NestedIntNullableFilter' + _min: + $ref: '#/components/schemas/NestedStringNullableFilter' + _max: + $ref: '#/components/schemas/NestedStringNullableFilter' + NestedIntNullableFilter: + type: object + properties: + equals: + oneOf: + - type: 'null' + - type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + - type: 'null' + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + - type: 'null' + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntNullableFilter' + - type: 'null' + NestedBoolFilter: + type: object + properties: + equals: + type: boolean + not: + oneOf: + - type: boolean + - $ref: '#/components/schemas/NestedBoolFilter' + NestedBoolWithAggregatesFilter: + type: object + properties: + equals: + type: boolean + not: + oneOf: + - type: boolean + - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedBoolFilter' + _max: + $ref: '#/components/schemas/NestedBoolFilter' + NestedIntWithAggregatesFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _avg: + $ref: '#/components/schemas/NestedFloatFilter' + _sum: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedIntFilter' + _max: + $ref: '#/components/schemas/NestedIntFilter' + NestedFloatFilter: + type: object + properties: + equals: + type: number + in: + oneOf: + - type: array + items: + type: number + - type: number + notIn: + oneOf: + - type: array + items: + type: number + - type: number + lt: + type: number + lte: + type: number + gt: + type: number + gte: + type: number + not: + oneOf: + - type: number + - $ref: '#/components/schemas/NestedFloatFilter' + Post_ItemCreateWithoutAuthorInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + published: + type: boolean + viewCount: + type: integer + notes: + oneOf: + - type: 'null' + - type: string + required: + - id + - title + Post_ItemUncheckedCreateWithoutAuthorInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + published: + type: boolean + viewCount: + type: integer + notes: + oneOf: + - type: 'null' + - type: string + required: + - id + - title + Post_ItemCreateOrConnectWithoutAuthorInput: + type: object + properties: + where: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + create: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + required: + - where + - create + Post_ItemCreateManyAuthorInputEnvelope: + type: object + properties: + data: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateManyAuthorInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemCreateManyAuthorInput' + skipDuplicates: + type: boolean + required: + - data + ProfileCreateWithoutUserInput: + type: object + properties: + id: + type: string + image: + oneOf: + - type: 'null' + - type: string + ProfileUncheckedCreateWithoutUserInput: + type: object + properties: + id: + type: string + image: + oneOf: + - type: 'null' + - type: string + ProfileCreateOrConnectWithoutUserInput: + type: object + properties: + where: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + required: + - where + - create + Post_ItemUpsertWithWhereUniqueWithoutAuthorInput: + type: object + properties: + where: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + update: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpdateWithoutAuthorInput' + - $ref: '#/components/schemas/Post_ItemUncheckedUpdateWithoutAuthorInput' + create: + oneOf: + - $ref: '#/components/schemas/Post_ItemCreateWithoutAuthorInput' + - $ref: '#/components/schemas/Post_ItemUncheckedCreateWithoutAuthorInput' + required: + - where + - update + - create + Post_ItemUpdateWithWhereUniqueWithoutAuthorInput: + type: object + properties: + where: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + data: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpdateWithoutAuthorInput' + - $ref: '#/components/schemas/Post_ItemUncheckedUpdateWithoutAuthorInput' + required: + - where + - data + Post_ItemUpdateManyWithWhereWithoutAuthorInput: + type: object + properties: + where: + $ref: '#/components/schemas/Post_ItemScalarWhereInput' + data: + oneOf: + - $ref: '#/components/schemas/Post_ItemUpdateManyMutationInput' + - $ref: '#/components/schemas/Post_ItemUncheckedUpdateManyWithoutPostsInput' + required: + - where + - data + Post_ItemScalarWhereInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/Post_ItemScalarWhereInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemScalarWhereInput' + OR: + type: array + items: + $ref: '#/components/schemas/Post_ItemScalarWhereInput' + NOT: + oneOf: + - $ref: '#/components/schemas/Post_ItemScalarWhereInput' + - type: array + items: + $ref: '#/components/schemas/Post_ItemScalarWhereInput' + id: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + createdAt: + oneOf: + - $ref: '#/components/schemas/DateTimeFilter' + - type: string + format: date-time + updatedAt: + oneOf: + - $ref: '#/components/schemas/DateTimeFilter' + - type: string + format: date-time + title: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + authorId: + oneOf: + - $ref: '#/components/schemas/StringNullableFilter' + - type: string + - type: 'null' + published: + oneOf: + - $ref: '#/components/schemas/BoolFilter' + - type: boolean + viewCount: + oneOf: + - $ref: '#/components/schemas/IntFilter' + - type: integer + notes: + oneOf: + - $ref: '#/components/schemas/StringNullableFilter' + - type: string + - type: 'null' + ProfileUpsertWithoutUserInput: + type: object + properties: + update: + oneOf: + - $ref: '#/components/schemas/ProfileUpdateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedUpdateWithoutUserInput' + create: + oneOf: + - $ref: '#/components/schemas/ProfileCreateWithoutUserInput' + - $ref: '#/components/schemas/ProfileUncheckedCreateWithoutUserInput' + required: + - update + - create + ProfileUpdateWithoutUserInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + image: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + - type: 'null' + ProfileUncheckedUpdateWithoutUserInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + image: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + - type: 'null' + UserCreateWithoutProfileInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/Role' + posts: + $ref: '#/components/schemas/Post_ItemCreateNestedManyWithoutAuthorInput' + required: + - email + UserUncheckedCreateWithoutProfileInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/Role' + posts: + $ref: "#/components/schemas/Post_ItemUncheckedCreateNestedManyWithoutAuthorInpu\ + t" + required: + - email + UserCreateOrConnectWithoutProfileInput: + type: object + properties: + where: + $ref: '#/components/schemas/UserWhereUniqueInput' + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput' + required: + - where + - create + UserUpsertWithoutProfileInput: + type: object + properties: + update: + oneOf: + - $ref: '#/components/schemas/UserUpdateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedUpdateWithoutProfileInput' + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutProfileInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutProfileInput' + required: + - update + - create + UserUpdateWithoutProfileInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + email: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + role: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' + posts: + $ref: '#/components/schemas/Post_ItemUpdateManyWithoutAuthorNestedInput' + UserUncheckedUpdateWithoutProfileInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + email: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + role: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' + posts: + $ref: "#/components/schemas/Post_ItemUncheckedUpdateManyWithoutAuthorNestedInpu\ + t" + UserCreateWithoutPostsInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/Role' + profile: + $ref: '#/components/schemas/ProfileCreateNestedOneWithoutUserInput' + required: + - email + UserUncheckedCreateWithoutPostsInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/Role' + profile: + $ref: '#/components/schemas/ProfileUncheckedCreateNestedOneWithoutUserInput' + required: + - email + UserCreateOrConnectWithoutPostsInput: + type: object + properties: + where: + $ref: '#/components/schemas/UserWhereUniqueInput' + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutPostsInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput' + required: + - where + - create + UserUpsertWithoutPostsInput: + type: object + properties: + update: + oneOf: + - $ref: '#/components/schemas/UserUpdateWithoutPostsInput' + - $ref: '#/components/schemas/UserUncheckedUpdateWithoutPostsInput' + create: + oneOf: + - $ref: '#/components/schemas/UserCreateWithoutPostsInput' + - $ref: '#/components/schemas/UserUncheckedCreateWithoutPostsInput' + required: + - update + - create + UserUpdateWithoutPostsInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + email: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + role: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' + profile: + $ref: '#/components/schemas/ProfileUpdateOneWithoutUserNestedInput' + UserUncheckedUpdateWithoutPostsInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + email: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + role: + oneOf: + - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/EnumroleFieldUpdateOperationsInput' + profile: + $ref: '#/components/schemas/ProfileUncheckedUpdateOneWithoutUserNestedInput' + Post_ItemCreateManyAuthorInput: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + published: + type: boolean + viewCount: + type: integer + notes: + oneOf: + - type: 'null' + - type: string + required: + - id + - title + Post_ItemUpdateWithoutAuthorInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + title: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + published: + oneOf: + - type: boolean + - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput' + viewCount: + oneOf: + - type: integer + - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + notes: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + - type: 'null' + Post_ItemUncheckedUpdateWithoutAuthorInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + title: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + published: + oneOf: + - type: boolean + - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput' + viewCount: + oneOf: + - type: integer + - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + notes: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + - type: 'null' + Post_ItemUncheckedUpdateManyWithoutPostsInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + createdAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + updatedAt: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + title: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + published: + oneOf: + - type: boolean + - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput' + viewCount: + oneOf: + - type: integer + - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + notes: + oneOf: + - type: string + - $ref: '#/components/schemas/NullableStringFieldUpdateOperationsInput' + - type: 'null' + UserArgs: + type: object + properties: + select: + $ref: '#/components/schemas/UserSelect' + include: + $ref: '#/components/schemas/UserInclude' + ProfileArgs: + type: object + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + include: + $ref: '#/components/schemas/ProfileInclude' + UserInclude: + type: object + properties: + posts: + oneOf: + - type: boolean + - $ref: '#/components/schemas/Post_ItemFindManyArgs' + profile: + oneOf: + - type: boolean + - $ref: '#/components/schemas/ProfileArgs' + _count: + oneOf: + - type: boolean + - $ref: '#/components/schemas/UserCountOutputTypeArgs' + ProfileInclude: + type: object + properties: + user: + oneOf: + - type: boolean + - $ref: '#/components/schemas/UserArgs' + Post_ItemInclude: + type: object + properties: + author: + oneOf: + - type: boolean + - $ref: '#/components/schemas/UserArgs' + UserCountOutputTypeSelect: + type: object + properties: + posts: + type: boolean + UserCountOutputTypeArgs: + type: object + properties: + select: + $ref: '#/components/schemas/UserCountOutputTypeSelect' + UserSelect: + type: object + properties: + id: + type: boolean + createdAt: + type: boolean + updatedAt: + type: boolean + email: + type: boolean + role: + type: boolean + posts: + oneOf: + - type: boolean + - $ref: '#/components/schemas/Post_ItemFindManyArgs' + profile: + oneOf: + - type: boolean + - $ref: '#/components/schemas/ProfileArgs' + _count: + oneOf: + - type: boolean + - $ref: '#/components/schemas/UserCountOutputTypeArgs' + ProfileSelect: + type: object + properties: + id: + type: boolean + image: + type: boolean + user: + oneOf: + - type: boolean + - $ref: '#/components/schemas/UserArgs' + userId: + type: boolean + Post_ItemSelect: + type: object + properties: + id: + type: boolean + createdAt: + type: boolean + updatedAt: + type: boolean + title: + type: boolean + author: + oneOf: + - type: boolean + - $ref: '#/components/schemas/UserArgs' + authorId: + type: boolean + published: + type: boolean + viewCount: + type: boolean + notes: + type: boolean + UserCountAggregateInput: + type: object + properties: + id: + type: boolean + createdAt: + type: boolean + updatedAt: + type: boolean + email: + type: boolean + role: + type: boolean + _all: + type: boolean + UserMinAggregateInput: + type: object + properties: + id: + type: boolean + createdAt: + type: boolean + updatedAt: + type: boolean + email: + type: boolean + role: + type: boolean + UserMaxAggregateInput: + type: object + properties: + id: + type: boolean + createdAt: + type: boolean + updatedAt: + type: boolean + email: + type: boolean + role: + type: boolean + ProfileCountAggregateInput: + type: object + properties: + id: + type: boolean + image: + type: boolean + userId: + type: boolean + _all: + type: boolean + ProfileMinAggregateInput: + type: object + properties: + id: + type: boolean + image: + type: boolean + userId: + type: boolean + ProfileMaxAggregateInput: + type: object + properties: + id: + type: boolean + image: + type: boolean + userId: + type: boolean + AggregateUser: + type: object + properties: + _count: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/UserCountAggregateOutputType' + _min: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/UserMinAggregateOutputType' + _max: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/UserMaxAggregateOutputType' + UserGroupByOutputType: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + email: + type: string + role: + $ref: '#/components/schemas/Role' + _count: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/UserCountAggregateOutputType' + _min: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/UserMinAggregateOutputType' + _max: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/UserMaxAggregateOutputType' + required: + - id + - createdAt + - updatedAt + - email + - role + AggregateProfile: + type: object + properties: + _count: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/ProfileCountAggregateOutputType' + _min: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/ProfileMinAggregateOutputType' + _max: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/ProfileMaxAggregateOutputType' + ProfileGroupByOutputType: + type: object + properties: + id: + type: string + image: + oneOf: + - type: 'null' + - type: string + userId: + type: string + _count: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/ProfileCountAggregateOutputType' + _min: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/ProfileMinAggregateOutputType' + _max: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/ProfileMaxAggregateOutputType' + required: + - id + - userId + AggregatePost_Item: + type: object + properties: + _count: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType' + _avg: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType' + _sum: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType' + _min: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType' + _max: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType' + Post_ItemGroupByOutputType: + type: object + properties: + id: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + title: + type: string + authorId: + oneOf: + - type: 'null' + - type: string + published: + type: boolean + viewCount: + type: integer + notes: + oneOf: + - type: 'null' + - type: string + _count: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType' + _avg: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Post_ItemAvgAggregateOutputType' + _sum: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Post_ItemSumAggregateOutputType' + _min: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Post_ItemMinAggregateOutputType' + _max: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Post_ItemMaxAggregateOutputType' + required: + - id + - createdAt + - updatedAt + - title + - published + - viewCount + UserCountAggregateOutputType: + type: object + properties: + id: + type: integer + createdAt: + type: integer + updatedAt: + type: integer + email: + type: integer + role: + type: integer + _all: + type: integer + required: + - id + - createdAt + - updatedAt + - email + - role + - _all + UserMinAggregateOutputType: + type: object + properties: + id: + oneOf: + - type: 'null' + - type: string + createdAt: + oneOf: + - type: 'null' + - type: string + format: date-time + updatedAt: + oneOf: + - type: 'null' + - type: string + format: date-time + email: + oneOf: + - type: 'null' + - type: string + role: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Role' + UserMaxAggregateOutputType: + type: object + properties: + id: + oneOf: + - type: 'null' + - type: string + createdAt: + oneOf: + - type: 'null' + - type: string + format: date-time + updatedAt: + oneOf: + - type: 'null' + - type: string + format: date-time + email: + oneOf: + - type: 'null' + - type: string + role: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Role' + ProfileCountAggregateOutputType: + type: object + properties: + id: + type: integer + image: + type: integer + userId: + type: integer + _all: + type: integer + required: + - id + - image + - userId + - _all + ProfileMinAggregateOutputType: + type: object + properties: + id: + oneOf: + - type: 'null' + - type: string + image: + oneOf: + - type: 'null' + - type: string + userId: + oneOf: + - type: 'null' + - type: string + ProfileMaxAggregateOutputType: + type: object + properties: + id: + oneOf: + - type: 'null' + - type: string + image: + oneOf: + - type: 'null' + - type: string + userId: + oneOf: + - type: 'null' + - type: string + Post_ItemCountAggregateOutputType: + type: object + properties: + id: + type: integer + createdAt: + type: integer + updatedAt: + type: integer + title: + type: integer + authorId: + type: integer + published: + type: integer + viewCount: + type: integer + notes: + type: integer + _all: + type: integer + required: + - id + - createdAt + - updatedAt + - title + - authorId + - published + - viewCount + - notes + - _all + Post_ItemAvgAggregateOutputType: + type: object + properties: + viewCount: + oneOf: + - type: 'null' + - type: number + Post_ItemSumAggregateOutputType: + type: object + properties: + viewCount: + oneOf: + - type: 'null' + - type: integer + Post_ItemMinAggregateOutputType: + type: object + properties: + id: + oneOf: + - type: 'null' + - type: string + createdAt: + oneOf: + - type: 'null' + - type: string + format: date-time + updatedAt: + oneOf: + - type: 'null' + - type: string + format: date-time + title: + oneOf: + - type: 'null' + - type: string + authorId: + oneOf: + - type: 'null' + - type: string + published: + oneOf: + - type: 'null' + - type: boolean + viewCount: + oneOf: + - type: 'null' + - type: integer + notes: + oneOf: + - type: 'null' + - type: string + Post_ItemMaxAggregateOutputType: + type: object + properties: + id: + oneOf: + - type: 'null' + - type: string + createdAt: + oneOf: + - type: 'null' + - type: string + format: date-time + updatedAt: + oneOf: + - type: 'null' + - type: string + format: date-time + title: + oneOf: + - type: 'null' + - type: string + authorId: + oneOf: + - type: 'null' + - type: string + published: + oneOf: + - type: 'null' + - type: boolean + viewCount: + oneOf: + - type: 'null' + - type: integer + notes: + oneOf: + - type: 'null' + - type: string + _Meta: + type: object + properties: + meta: + type: object + description: Meta information about the request or response + properties: + serialization: + description: Serialization metadata + additionalProperties: true + _Error: + type: object + required: + - error + properties: + error: + type: object + required: + - message + properties: + prisma: + type: boolean + description: Indicates if the error occurred during a Prisma call + rejectedByPolicy: + type: boolean + description: Indicates if the error was due to rejection by a policy + code: + type: string + description: Prisma error code. Only available when "prisma" field is true. + message: + type: string + description: Error message + reason: + type: string + description: Detailed error reason + zodErrors: + type: object + additionalProperties: true + description: Zod validation errors if the error is due to data validation + failure + additionalProperties: true + BatchPayload: + type: object + properties: + count: + type: integer + UserCreateArgs: + type: object + required: + - data + properties: + select: + $ref: '#/components/schemas/UserSelect' + include: + $ref: '#/components/schemas/UserInclude' + data: + $ref: '#/components/schemas/UserCreateInput' + meta: + $ref: '#/components/schemas/_Meta' + UserCreateManyArgs: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/UserCreateManyInput' + meta: + $ref: '#/components/schemas/_Meta' + UserFindUniqueArgs: + type: object + required: + - where + properties: + select: + $ref: '#/components/schemas/UserSelect' + include: + $ref: '#/components/schemas/UserInclude' + where: + $ref: '#/components/schemas/UserWhereUniqueInput' + meta: + $ref: '#/components/schemas/_Meta' + UserFindFirstArgs: + type: object + properties: + select: + $ref: '#/components/schemas/UserSelect' + include: + $ref: '#/components/schemas/UserInclude' + where: + $ref: '#/components/schemas/UserWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + UserFindManyArgs: + type: object + properties: + select: + $ref: '#/components/schemas/UserSelect' + include: + $ref: '#/components/schemas/UserInclude' + where: + $ref: '#/components/schemas/UserWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + UserUpdateArgs: + type: object + required: + - where + - data + properties: + select: + $ref: '#/components/schemas/UserSelect' + include: + $ref: '#/components/schemas/UserInclude' + where: + $ref: '#/components/schemas/UserWhereUniqueInput' + data: + $ref: '#/components/schemas/UserUpdateInput' + meta: + $ref: '#/components/schemas/_Meta' + UserUpdateManyArgs: + type: object + required: + - data + properties: + where: + $ref: '#/components/schemas/UserWhereInput' + data: + $ref: '#/components/schemas/UserUpdateManyMutationInput' + meta: + $ref: '#/components/schemas/_Meta' + UserUpsertArgs: + type: object + required: + - create + - update + - where + properties: + select: + $ref: '#/components/schemas/UserSelect' + include: + $ref: '#/components/schemas/UserInclude' + where: + $ref: '#/components/schemas/UserWhereUniqueInput' + create: + $ref: '#/components/schemas/UserCreateInput' + update: + $ref: '#/components/schemas/UserUpdateInput' + meta: + $ref: '#/components/schemas/_Meta' + UserDeleteUniqueArgs: + type: object + required: + - where + properties: + select: + $ref: '#/components/schemas/UserSelect' + include: + $ref: '#/components/schemas/UserInclude' + where: + $ref: '#/components/schemas/UserWhereUniqueInput' + meta: + $ref: '#/components/schemas/_Meta' + UserDeleteManyArgs: + type: object + properties: + where: + $ref: '#/components/schemas/UserWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + UserCountArgs: + type: object + properties: + select: + $ref: '#/components/schemas/UserSelect' + where: + $ref: '#/components/schemas/UserWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + UserAggregateArgs: + type: object + properties: + where: + $ref: '#/components/schemas/UserWhereInput' + orderBy: + $ref: '#/components/schemas/UserOrderByWithRelationInput' + cursor: + $ref: '#/components/schemas/UserWhereUniqueInput' + take: + type: integer + skip: + type: integer + _count: + oneOf: + - type: boolean + - $ref: '#/components/schemas/UserCountAggregateInput' + _min: + $ref: '#/components/schemas/UserMinAggregateInput' + _max: + $ref: '#/components/schemas/UserMaxAggregateInput' + meta: + $ref: '#/components/schemas/_Meta' + UserGroupByArgs: + type: object + properties: + where: + $ref: '#/components/schemas/UserWhereInput' + orderBy: + $ref: '#/components/schemas/UserOrderByWithRelationInput' + by: + $ref: '#/components/schemas/UserScalarFieldEnum' + having: + $ref: '#/components/schemas/UserScalarWhereWithAggregatesInput' + take: + type: integer + skip: + type: integer + _count: + oneOf: + - type: boolean + - $ref: '#/components/schemas/UserCountAggregateInput' + _min: + $ref: '#/components/schemas/UserMinAggregateInput' + _max: + $ref: '#/components/schemas/UserMaxAggregateInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileCreateArgs: + type: object + required: + - data + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + include: + $ref: '#/components/schemas/ProfileInclude' + data: + $ref: '#/components/schemas/ProfileCreateInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileCreateManyArgs: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/ProfileCreateManyInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileFindUniqueArgs: + type: object + required: + - where + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + include: + $ref: '#/components/schemas/ProfileInclude' + where: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileFindFirstArgs: + type: object + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + include: + $ref: '#/components/schemas/ProfileInclude' + where: + $ref: '#/components/schemas/ProfileWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileFindManyArgs: + type: object + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + include: + $ref: '#/components/schemas/ProfileInclude' + where: + $ref: '#/components/schemas/ProfileWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileUpdateArgs: + type: object + required: + - where + - data + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + include: + $ref: '#/components/schemas/ProfileInclude' + where: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + data: + $ref: '#/components/schemas/ProfileUpdateInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileUpdateManyArgs: + type: object + required: + - data + properties: + where: + $ref: '#/components/schemas/ProfileWhereInput' + data: + $ref: '#/components/schemas/ProfileUpdateManyMutationInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileUpsertArgs: + type: object + required: + - create + - update + - where + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + include: + $ref: '#/components/schemas/ProfileInclude' + where: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + create: + $ref: '#/components/schemas/ProfileCreateInput' + update: + $ref: '#/components/schemas/ProfileUpdateInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileDeleteUniqueArgs: + type: object + required: + - where + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + include: + $ref: '#/components/schemas/ProfileInclude' + where: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileDeleteManyArgs: + type: object + properties: + where: + $ref: '#/components/schemas/ProfileWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileCountArgs: + type: object + properties: + select: + $ref: '#/components/schemas/ProfileSelect' + where: + $ref: '#/components/schemas/ProfileWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileAggregateArgs: + type: object + properties: + where: + $ref: '#/components/schemas/ProfileWhereInput' + orderBy: + $ref: '#/components/schemas/ProfileOrderByWithRelationInput' + cursor: + $ref: '#/components/schemas/ProfileWhereUniqueInput' + take: + type: integer + skip: + type: integer + _count: + oneOf: + - type: boolean + - $ref: '#/components/schemas/ProfileCountAggregateInput' + _min: + $ref: '#/components/schemas/ProfileMinAggregateInput' + _max: + $ref: '#/components/schemas/ProfileMaxAggregateInput' + meta: + $ref: '#/components/schemas/_Meta' + ProfileGroupByArgs: + type: object + properties: + where: + $ref: '#/components/schemas/ProfileWhereInput' + orderBy: + $ref: '#/components/schemas/ProfileOrderByWithRelationInput' + by: + $ref: '#/components/schemas/ProfileScalarFieldEnum' + having: + $ref: '#/components/schemas/ProfileScalarWhereWithAggregatesInput' + take: + type: integer + skip: + type: integer + _count: + oneOf: + - type: boolean + - $ref: '#/components/schemas/ProfileCountAggregateInput' + _min: + $ref: '#/components/schemas/ProfileMinAggregateInput' + _max: + $ref: '#/components/schemas/ProfileMaxAggregateInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemCreateArgs: + type: object + required: + - data + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + data: + $ref: '#/components/schemas/Post_ItemCreateInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemCreateManyArgs: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Post_ItemCreateManyInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemFindUniqueArgs: + type: object + required: + - where + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemFindFirstArgs: + type: object + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemFindManyArgs: + type: object + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemUpdateArgs: + type: object + required: + - where + - data + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + data: + $ref: '#/components/schemas/Post_ItemUpdateInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemUpdateManyArgs: + type: object + required: + - data + properties: + where: + $ref: '#/components/schemas/Post_ItemWhereInput' + data: + $ref: '#/components/schemas/Post_ItemUpdateManyMutationInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemUpsertArgs: + type: object + required: + - create + - update + - where + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + create: + $ref: '#/components/schemas/Post_ItemCreateInput' + update: + $ref: '#/components/schemas/Post_ItemUpdateInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemDeleteUniqueArgs: + type: object + required: + - where + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + include: + $ref: '#/components/schemas/Post_ItemInclude' + where: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemDeleteManyArgs: + type: object + properties: + where: + $ref: '#/components/schemas/Post_ItemWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemCountArgs: + type: object + properties: + select: + $ref: '#/components/schemas/Post_ItemSelect' + where: + $ref: '#/components/schemas/Post_ItemWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemAggregateArgs: + type: object + properties: + where: + $ref: '#/components/schemas/Post_ItemWhereInput' + orderBy: + $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput' + cursor: + $ref: '#/components/schemas/Post_ItemWhereUniqueInput' + take: + type: integer + skip: + type: integer + meta: + $ref: '#/components/schemas/_Meta' + Post_ItemGroupByArgs: + type: object + properties: + where: + $ref: '#/components/schemas/Post_ItemWhereInput' + orderBy: + $ref: '#/components/schemas/Post_ItemOrderByWithRelationInput' + by: + $ref: '#/components/schemas/Post_ItemScalarFieldEnum' + having: + $ref: '#/components/schemas/Post_ItemScalarWhereWithAggregatesInput' + take: + type: integer + skip: + type: integer + meta: + $ref: '#/components/schemas/_Meta' +paths: + /user/create: + post: + operationId: createUser + description: Create a new User + tags: + - user + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/User' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserCreateArgs' + /user/createMany: + post: + operationId: createManyUser + description: Create several User + tags: + - user + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserCreateManyArgs' + /user/findUnique: + get: + operationId: findUniqueUser + description: Find one unique User + tags: + - user + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/User' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/UserFindUniqueArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /user/findFirst: + get: + operationId: findFirstUser + description: Find the first User matching the given condition + tags: + - user + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/User' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/UserFindFirstArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /user/findMany: + get: + operationId: findManyUser + description: Find users matching the given conditions + tags: + - user + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/User' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/UserFindManyArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /user/update: + patch: + operationId: updateUser + description: Update a User + tags: + - user + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/User' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpdateArgs' + /user/updateMany: + patch: + operationId: updateManyUser + description: Update Users matching the given condition + tags: + - user + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpdateManyArgs' + /user/upsert: + post: + operationId: upsertUser + description: Upsert a User + tags: + - user + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/User' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpsertArgs' + /user/dodelete: + put: + operationId: deleteUser + description: Delete a unique user + tags: + - delete + - user + summary: Delete a user yeah yeah + deprecated: true + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/User' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserDeleteUniqueArgs' + /user/deleteMany: + delete: + operationId: deleteManyUser + description: Delete Users matching the given condition + tags: + - user + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/UserDeleteManyArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /user/count: + get: + operationId: countUser + description: Find a list of User + tags: + - user + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + oneOf: + - type: integer + - $ref: '#/components/schemas/UserCountAggregateOutputType' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/UserCountArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /user/aggregate: + get: + operationId: aggregateUser + description: Aggregate Users + tags: + - user + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/AggregateUser' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/UserAggregateArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /user/groupBy: + get: + operationId: groupByUser + description: Group Users by fields + tags: + - user + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/UserGroupByOutputType' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/UserGroupByArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/create: + post: + operationId: createProfile + description: Create a new Profile + tags: + - profile + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileCreateArgs' + /profile/createMany: + post: + operationId: createManyProfile + description: Create several Profile + tags: + - profile + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileCreateManyArgs' + /profile/findUnique: + get: + operationId: findUniqueProfile + description: Find one unique Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileFindUniqueArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/findFirst: + get: + operationId: findFirstProfile + description: Find the first Profile matching the given condition + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileFindFirstArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/findMany: + get: + operationId: findManyProfile + description: Find a list of Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileFindManyArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/update: + patch: + operationId: updateProfile + description: Update a Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileUpdateArgs' + /profile/updateMany: + patch: + operationId: updateManyProfile + description: Update Profiles matching the given condition + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileUpdateManyArgs' + /profile/upsert: + post: + operationId: upsertProfile + description: Upsert a Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileUpsertArgs' + /profile/delete: + delete: + operationId: deleteProfile + description: Delete one unique Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Profile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileDeleteUniqueArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/deleteMany: + delete: + operationId: deleteManyProfile + description: Delete Profiles matching the given condition + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileDeleteManyArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/count: + get: + operationId: countProfile + description: Find a list of Profile + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + oneOf: + - type: integer + - $ref: '#/components/schemas/ProfileCountAggregateOutputType' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileCountArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/aggregate: + get: + operationId: aggregateProfile + description: Aggregate Profiles + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/AggregateProfile' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileAggregateArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /profile/groupBy: + get: + operationId: groupByProfile + description: Group Profiles by fields + tags: + - profile + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/ProfileGroupByOutputType' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileGroupByArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /post_Item/create: + post: + operationId: createPost_Item + description: Create a new Post_Item + tags: + - post_Item + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Post_Item' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemCreateArgs' + /post_Item/createMany: + post: + operationId: createManyPost_Item + description: Create several Post_Item + tags: + - post_Item + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemCreateManyArgs' + /post_Item/findUnique: + get: + operationId: findUniquePost_Item + description: Find one unique Post_Item + tags: + - post_Item + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Post_Item' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemFindUniqueArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /post_Item/findFirst: + get: + operationId: findFirstPost_Item + description: Find the first Post_Item matching the given condition + tags: + - post_Item + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Post_Item' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemFindFirstArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /post_Item/update: + patch: + operationId: updatePost_Item + description: Update a Post_Item + tags: + - post_Item + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Post_Item' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemUpdateArgs' + /post_Item/updateMany: + patch: + operationId: updateManyPost_Item + description: Update Post_Items matching the given condition + tags: + - post_Item + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemUpdateManyArgs' + /post_Item/upsert: + post: + operationId: upsertPost_Item + description: Upsert a Post_Item + tags: + - post_Item + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Post_Item' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemUpsertArgs' + /post_Item/delete: + delete: + operationId: deletePost_Item + description: Delete one unique Post_Item + tags: + - post_Item + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Post_Item' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemDeleteUniqueArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /post_Item/deleteMany: + delete: + operationId: deleteManyPost_Item + description: Delete Post_Items matching the given condition + tags: + - post_Item + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemDeleteManyArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /post_Item/count: + get: + operationId: countPost_Item + description: Find a list of Post_Item + tags: + - post_Item + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + oneOf: + - type: integer + - $ref: '#/components/schemas/Post_ItemCountAggregateOutputType' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemCountArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /post_Item/aggregate: + get: + operationId: aggregatePost_Item + description: Aggregate Post_Items + tags: + - post_Item + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/AggregatePost_Item' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemAggregateArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /post_Item/groupBy: + get: + operationId: groupByPost_Item + description: Group Post_Items by fields + tags: + - post_Item + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/Post_ItemGroupByOutputType' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/Post_ItemGroupByArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} diff --git a/packages/plugins/openapi/tests/baseline/rpc-type-coverage.baseline.yaml b/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.0.0.baseline.yaml similarity index 94% rename from packages/plugins/openapi/tests/baseline/rpc-type-coverage.baseline.yaml rename to packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.0.0.baseline.yaml index cbe6476f8..6e219e6e3 100644 --- a/packages/plugins/openapi/tests/baseline/rpc-type-coverage.baseline.yaml +++ b/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.0.0.baseline.yaml @@ -1,4 +1,4 @@ -openapi: 3.1.0 +openapi: 3.0.0 info: title: ZenStack Generated API version: 1.0.0 @@ -29,6 +29,11 @@ components: enum: - default - insensitive + NullsOrder: + type: string + enum: + - first + - last Foo: type: object properties: @@ -54,6 +59,7 @@ components: bytes: type: string format: byte + nullable: true required: - id - string @@ -63,7 +69,6 @@ components: - float - decimal - boolean - - bytes FooWhereInput: type: object properties: @@ -120,9 +125,10 @@ components: - type: boolean bytes: oneOf: - - $ref: '#/components/schemas/BytesFilter' + - $ref: '#/components/schemas/BytesNullableFilter' - type: string format: byte + nullable: true FooOrderByWithRelationInput: type: object properties: @@ -143,7 +149,9 @@ components: boolean: $ref: '#/components/schemas/SortOrder' bytes: - $ref: '#/components/schemas/SortOrder' + oneOf: + - $ref: '#/components/schemas/SortOrder' + - $ref: '#/components/schemas/SortOrderInput' FooWhereUniqueInput: type: object properties: @@ -205,9 +213,10 @@ components: - type: boolean bytes: oneOf: - - $ref: '#/components/schemas/BytesWithAggregatesFilter' + - $ref: '#/components/schemas/BytesNullableWithAggregatesFilter' - type: string format: byte + nullable: true FooCreateInput: type: object properties: @@ -233,6 +242,7 @@ components: bytes: type: string format: byte + nullable: true required: - string - int @@ -241,7 +251,6 @@ components: - float - decimal - boolean - - bytes FooUpdateInput: type: object properties: @@ -284,7 +293,8 @@ components: oneOf: - type: string format: byte - - $ref: '#/components/schemas/BytesFieldUpdateOperationsInput' + - $ref: '#/components/schemas/NullableBytesFieldUpdateOperationsInput' + nullable: true FooCreateManyInput: type: object properties: @@ -310,6 +320,7 @@ components: bytes: type: string format: byte + nullable: true required: - string - int @@ -318,7 +329,6 @@ components: - float - decimal - boolean - - bytes FooUpdateManyMutationInput: type: object properties: @@ -361,7 +371,8 @@ components: oneOf: - type: string format: byte - - $ref: '#/components/schemas/BytesFieldUpdateOperationsInput' + - $ref: '#/components/schemas/NullableBytesFieldUpdateOperationsInput' + nullable: true StringFilter: type: object properties: @@ -583,12 +594,13 @@ components: oneOf: - type: boolean - $ref: '#/components/schemas/NestedBoolFilter' - BytesFilter: + BytesNullableFilter: type: object properties: equals: type: string format: byte + nullable: true in: oneOf: - type: array @@ -597,6 +609,7 @@ components: format: byte - type: string format: byte + nullable: true notIn: oneOf: - type: array @@ -605,11 +618,22 @@ components: format: byte - type: string format: byte + nullable: true not: oneOf: - type: string format: byte - - $ref: '#/components/schemas/NestedBytesFilter' + - $ref: '#/components/schemas/NestedBytesNullableFilter' + nullable: true + SortOrderInput: + type: object + properties: + sort: + $ref: '#/components/schemas/SortOrder' + nulls: + $ref: '#/components/schemas/NullsOrder' + required: + - sort StringWithAggregatesFilter: type: object properties: @@ -889,12 +913,13 @@ components: $ref: '#/components/schemas/NestedBoolFilter' _max: $ref: '#/components/schemas/NestedBoolFilter' - BytesWithAggregatesFilter: + BytesNullableWithAggregatesFilter: type: object properties: equals: type: string format: byte + nullable: true in: oneOf: - type: array @@ -903,6 +928,7 @@ components: format: byte - type: string format: byte + nullable: true notIn: oneOf: - type: array @@ -911,17 +937,19 @@ components: format: byte - type: string format: byte + nullable: true not: oneOf: - type: string format: byte - - $ref: '#/components/schemas/NestedBytesWithAggregatesFilter' + - $ref: '#/components/schemas/NestedBytesNullableWithAggregatesFilter' + nullable: true _count: - $ref: '#/components/schemas/NestedIntFilter' + $ref: '#/components/schemas/NestedIntNullableFilter' _min: - $ref: '#/components/schemas/NestedBytesFilter' + $ref: '#/components/schemas/NestedBytesNullableFilter' _max: - $ref: '#/components/schemas/NestedBytesFilter' + $ref: '#/components/schemas/NestedBytesNullableFilter' StringFieldUpdateOperationsInput: type: object properties: @@ -1000,12 +1028,13 @@ components: properties: set: type: boolean - BytesFieldUpdateOperationsInput: + NullableBytesFieldUpdateOperationsInput: type: object properties: set: type: string format: byte + nullable: true NestedStringFilter: type: object properties: @@ -1225,12 +1254,13 @@ components: oneOf: - type: boolean - $ref: '#/components/schemas/NestedBoolFilter' - NestedBytesFilter: + NestedBytesNullableFilter: type: object properties: equals: type: string format: byte + nullable: true in: oneOf: - type: array @@ -1239,6 +1269,7 @@ components: format: byte - type: string format: byte + nullable: true notIn: oneOf: - type: array @@ -1247,11 +1278,13 @@ components: format: byte - type: string format: byte + nullable: true not: oneOf: - type: string format: byte - - $ref: '#/components/schemas/NestedBytesFilter' + - $ref: '#/components/schemas/NestedBytesNullableFilter' + nullable: true NestedStringWithAggregatesFilter: type: object properties: @@ -1529,12 +1562,13 @@ components: $ref: '#/components/schemas/NestedBoolFilter' _max: $ref: '#/components/schemas/NestedBoolFilter' - NestedBytesWithAggregatesFilter: + NestedBytesNullableWithAggregatesFilter: type: object properties: equals: type: string format: byte + nullable: true in: oneOf: - type: array @@ -1543,6 +1577,7 @@ components: format: byte - type: string format: byte + nullable: true notIn: oneOf: - type: array @@ -1551,17 +1586,52 @@ components: format: byte - type: string format: byte + nullable: true not: oneOf: - type: string format: byte - - $ref: '#/components/schemas/NestedBytesWithAggregatesFilter' + - $ref: '#/components/schemas/NestedBytesNullableWithAggregatesFilter' + nullable: true _count: - $ref: '#/components/schemas/NestedIntFilter' + $ref: '#/components/schemas/NestedIntNullableFilter' _min: - $ref: '#/components/schemas/NestedBytesFilter' + $ref: '#/components/schemas/NestedBytesNullableFilter' _max: - $ref: '#/components/schemas/NestedBytesFilter' + $ref: '#/components/schemas/NestedBytesNullableFilter' + NestedIntNullableFilter: + type: object + properties: + equals: + type: integer + nullable: true + in: + oneOf: + - type: array + items: + type: integer + - type: integer + nullable: true + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + nullable: true + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntNullableFilter' + nullable: true FooSelect: type: object properties: @@ -1674,15 +1744,25 @@ components: type: object properties: _count: - $ref: '#/components/schemas/FooCountAggregateOutputType' + allOf: + - $ref: '#/components/schemas/FooCountAggregateOutputType' + nullable: true _avg: - $ref: '#/components/schemas/FooAvgAggregateOutputType' + allOf: + - $ref: '#/components/schemas/FooAvgAggregateOutputType' + nullable: true _sum: - $ref: '#/components/schemas/FooSumAggregateOutputType' + allOf: + - $ref: '#/components/schemas/FooSumAggregateOutputType' + nullable: true _min: - $ref: '#/components/schemas/FooMinAggregateOutputType' + allOf: + - $ref: '#/components/schemas/FooMinAggregateOutputType' + nullable: true _max: - $ref: '#/components/schemas/FooMaxAggregateOutputType' + allOf: + - $ref: '#/components/schemas/FooMaxAggregateOutputType' + nullable: true FooGroupByOutputType: type: object properties: @@ -1708,16 +1788,27 @@ components: bytes: type: string format: byte + nullable: true _count: - $ref: '#/components/schemas/FooCountAggregateOutputType' + allOf: + - $ref: '#/components/schemas/FooCountAggregateOutputType' + nullable: true _avg: - $ref: '#/components/schemas/FooAvgAggregateOutputType' + allOf: + - $ref: '#/components/schemas/FooAvgAggregateOutputType' + nullable: true _sum: - $ref: '#/components/schemas/FooSumAggregateOutputType' + allOf: + - $ref: '#/components/schemas/FooSumAggregateOutputType' + nullable: true _min: - $ref: '#/components/schemas/FooMinAggregateOutputType' + allOf: + - $ref: '#/components/schemas/FooMinAggregateOutputType' + nullable: true _max: - $ref: '#/components/schemas/FooMaxAggregateOutputType' + allOf: + - $ref: '#/components/schemas/FooMaxAggregateOutputType' + nullable: true required: - id - string @@ -1727,7 +1818,6 @@ components: - float - decimal - boolean - - bytes FooCountAggregateOutputType: type: object properties: @@ -1767,77 +1857,103 @@ components: properties: int: type: number + nullable: true bigInt: type: number + nullable: true float: type: number + nullable: true decimal: oneOf: - type: string - type: number + nullable: true FooSumAggregateOutputType: type: object properties: int: type: integer + nullable: true bigInt: type: integer + nullable: true float: type: number + nullable: true decimal: oneOf: - type: string - type: number + nullable: true FooMinAggregateOutputType: type: object properties: id: type: string + nullable: true string: type: string + nullable: true int: type: integer + nullable: true bigInt: type: integer + nullable: true date: type: string format: date-time + nullable: true float: type: number + nullable: true decimal: oneOf: - type: string - type: number + nullable: true boolean: type: boolean + nullable: true bytes: type: string format: byte + nullable: true FooMaxAggregateOutputType: type: object properties: id: type: string + nullable: true string: type: string + nullable: true int: type: integer + nullable: true bigInt: type: integer + nullable: true date: type: string format: date-time + nullable: true float: type: number + nullable: true decimal: oneOf: - type: string - type: number + nullable: true boolean: type: boolean + nullable: true bytes: type: string format: byte + nullable: true _Meta: type: object properties: diff --git a/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.1.0.baseline.yaml b/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.1.0.baseline.yaml new file mode 100644 index 000000000..e777f7580 --- /dev/null +++ b/packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.1.0.baseline.yaml @@ -0,0 +1,2815 @@ +openapi: 3.1.0 +info: + title: ZenStack Generated API + version: 1.0.0 +tags: + - name: foo + description: Foo operations +components: + schemas: + FooScalarFieldEnum: + type: string + enum: + - id + - string + - int + - bigInt + - date + - float + - decimal + - boolean + - bytes + SortOrder: + type: string + enum: + - asc + - desc + QueryMode: + type: string + enum: + - default + - insensitive + NullsOrder: + type: string + enum: + - first + - last + Foo: + type: object + properties: + id: + type: string + string: + type: string + int: + type: integer + bigInt: + type: integer + date: + type: string + format: date-time + float: + type: number + decimal: + oneOf: + - type: string + - type: number + boolean: + type: boolean + bytes: + oneOf: + - type: 'null' + - type: string + format: byte + required: + - id + - string + - int + - bigInt + - date + - float + - decimal + - boolean + FooWhereInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/FooWhereInput' + - type: array + items: + $ref: '#/components/schemas/FooWhereInput' + OR: + type: array + items: + $ref: '#/components/schemas/FooWhereInput' + NOT: + oneOf: + - $ref: '#/components/schemas/FooWhereInput' + - type: array + items: + $ref: '#/components/schemas/FooWhereInput' + id: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + string: + oneOf: + - $ref: '#/components/schemas/StringFilter' + - type: string + int: + oneOf: + - $ref: '#/components/schemas/IntFilter' + - type: integer + bigInt: + oneOf: + - $ref: '#/components/schemas/BigIntFilter' + - type: integer + date: + oneOf: + - $ref: '#/components/schemas/DateTimeFilter' + - type: string + format: date-time + float: + oneOf: + - $ref: '#/components/schemas/FloatFilter' + - type: number + decimal: + oneOf: + - $ref: '#/components/schemas/DecimalFilter' + - oneOf: + - type: string + - type: number + boolean: + oneOf: + - $ref: '#/components/schemas/BoolFilter' + - type: boolean + bytes: + oneOf: + - $ref: '#/components/schemas/BytesNullableFilter' + - type: string + format: byte + - type: 'null' + FooOrderByWithRelationInput: + type: object + properties: + id: + $ref: '#/components/schemas/SortOrder' + string: + $ref: '#/components/schemas/SortOrder' + int: + $ref: '#/components/schemas/SortOrder' + bigInt: + $ref: '#/components/schemas/SortOrder' + date: + $ref: '#/components/schemas/SortOrder' + float: + $ref: '#/components/schemas/SortOrder' + decimal: + $ref: '#/components/schemas/SortOrder' + boolean: + $ref: '#/components/schemas/SortOrder' + bytes: + oneOf: + - $ref: '#/components/schemas/SortOrder' + - $ref: '#/components/schemas/SortOrderInput' + FooWhereUniqueInput: + type: object + properties: + id: + type: string + FooScalarWhereWithAggregatesInput: + type: object + properties: + AND: + oneOf: + - $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput' + - type: array + items: + $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput' + OR: + type: array + items: + $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput' + NOT: + oneOf: + - $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput' + - type: array + items: + $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput' + id: + oneOf: + - $ref: '#/components/schemas/StringWithAggregatesFilter' + - type: string + string: + oneOf: + - $ref: '#/components/schemas/StringWithAggregatesFilter' + - type: string + int: + oneOf: + - $ref: '#/components/schemas/IntWithAggregatesFilter' + - type: integer + bigInt: + oneOf: + - $ref: '#/components/schemas/BigIntWithAggregatesFilter' + - type: integer + date: + oneOf: + - $ref: '#/components/schemas/DateTimeWithAggregatesFilter' + - type: string + format: date-time + float: + oneOf: + - $ref: '#/components/schemas/FloatWithAggregatesFilter' + - type: number + decimal: + oneOf: + - $ref: '#/components/schemas/DecimalWithAggregatesFilter' + - oneOf: + - type: string + - type: number + boolean: + oneOf: + - $ref: '#/components/schemas/BoolWithAggregatesFilter' + - type: boolean + bytes: + oneOf: + - $ref: '#/components/schemas/BytesNullableWithAggregatesFilter' + - type: string + format: byte + - type: 'null' + FooCreateInput: + type: object + properties: + id: + type: string + string: + type: string + int: + type: integer + bigInt: + type: integer + date: + type: string + format: date-time + float: + type: number + decimal: + oneOf: + - type: string + - type: number + boolean: + type: boolean + bytes: + oneOf: + - type: 'null' + - type: string + format: byte + required: + - string + - int + - bigInt + - date + - float + - decimal + - boolean + FooUpdateInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + string: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + int: + oneOf: + - type: integer + - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + bigInt: + oneOf: + - type: integer + - $ref: '#/components/schemas/BigIntFieldUpdateOperationsInput' + date: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + float: + oneOf: + - type: number + - $ref: '#/components/schemas/FloatFieldUpdateOperationsInput' + decimal: + oneOf: + - oneOf: + - type: string + - type: number + - $ref: '#/components/schemas/DecimalFieldUpdateOperationsInput' + boolean: + oneOf: + - type: boolean + - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput' + bytes: + oneOf: + - type: string + format: byte + - $ref: '#/components/schemas/NullableBytesFieldUpdateOperationsInput' + - type: 'null' + FooCreateManyInput: + type: object + properties: + id: + type: string + string: + type: string + int: + type: integer + bigInt: + type: integer + date: + type: string + format: date-time + float: + type: number + decimal: + oneOf: + - type: string + - type: number + boolean: + type: boolean + bytes: + oneOf: + - type: 'null' + - type: string + format: byte + required: + - string + - int + - bigInt + - date + - float + - decimal + - boolean + FooUpdateManyMutationInput: + type: object + properties: + id: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + string: + oneOf: + - type: string + - $ref: '#/components/schemas/StringFieldUpdateOperationsInput' + int: + oneOf: + - type: integer + - $ref: '#/components/schemas/IntFieldUpdateOperationsInput' + bigInt: + oneOf: + - type: integer + - $ref: '#/components/schemas/BigIntFieldUpdateOperationsInput' + date: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/DateTimeFieldUpdateOperationsInput' + float: + oneOf: + - type: number + - $ref: '#/components/schemas/FloatFieldUpdateOperationsInput' + decimal: + oneOf: + - oneOf: + - type: string + - type: number + - $ref: '#/components/schemas/DecimalFieldUpdateOperationsInput' + boolean: + oneOf: + - type: boolean + - $ref: '#/components/schemas/BoolFieldUpdateOperationsInput' + bytes: + oneOf: + - type: string + format: byte + - $ref: '#/components/schemas/NullableBytesFieldUpdateOperationsInput' + - type: 'null' + StringFilter: + type: object + properties: + equals: + type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + notIn: + oneOf: + - type: array + items: + type: string + - type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + mode: + $ref: '#/components/schemas/QueryMode' + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringFilter' + IntFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntFilter' + BigIntFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedBigIntFilter' + DateTimeFilter: + type: object + properties: + equals: + type: string + format: date-time + in: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + notIn: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + lt: + type: string + format: date-time + lte: + type: string + format: date-time + gt: + type: string + format: date-time + gte: + type: string + format: date-time + not: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/NestedDateTimeFilter' + FloatFilter: + type: object + properties: + equals: + type: number + in: + oneOf: + - type: array + items: + type: number + - type: number + notIn: + oneOf: + - type: array + items: + type: number + - type: number + lt: + type: number + lte: + type: number + gt: + type: number + gte: + type: number + not: + oneOf: + - type: number + - $ref: '#/components/schemas/NestedFloatFilter' + DecimalFilter: + type: object + properties: + equals: + oneOf: + - type: string + - type: number + in: + oneOf: + - type: array + items: + oneOf: + - type: string + - type: number + - oneOf: + - type: string + - type: number + notIn: + oneOf: + - type: array + items: + oneOf: + - type: string + - type: number + - oneOf: + - type: string + - type: number + lt: + oneOf: + - type: string + - type: number + lte: + oneOf: + - type: string + - type: number + gt: + oneOf: + - type: string + - type: number + gte: + oneOf: + - type: string + - type: number + not: + oneOf: + - oneOf: + - type: string + - type: number + - $ref: '#/components/schemas/NestedDecimalFilter' + BoolFilter: + type: object + properties: + equals: + type: boolean + not: + oneOf: + - type: boolean + - $ref: '#/components/schemas/NestedBoolFilter' + BytesNullableFilter: + type: object + properties: + equals: + oneOf: + - type: 'null' + - type: string + format: byte + in: + oneOf: + - type: array + items: + type: string + format: byte + - type: string + format: byte + - type: 'null' + notIn: + oneOf: + - type: array + items: + type: string + format: byte + - type: string + format: byte + - type: 'null' + not: + oneOf: + - type: string + format: byte + - $ref: '#/components/schemas/NestedBytesNullableFilter' + - type: 'null' + SortOrderInput: + type: object + properties: + sort: + $ref: '#/components/schemas/SortOrder' + nulls: + $ref: '#/components/schemas/NullsOrder' + required: + - sort + StringWithAggregatesFilter: + type: object + properties: + equals: + type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + notIn: + oneOf: + - type: array + items: + type: string + - type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + mode: + $ref: '#/components/schemas/QueryMode' + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedStringFilter' + _max: + $ref: '#/components/schemas/NestedStringFilter' + IntWithAggregatesFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _avg: + $ref: '#/components/schemas/NestedFloatFilter' + _sum: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedIntFilter' + _max: + $ref: '#/components/schemas/NestedIntFilter' + BigIntWithAggregatesFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedBigIntWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _avg: + $ref: '#/components/schemas/NestedFloatFilter' + _sum: + $ref: '#/components/schemas/NestedBigIntFilter' + _min: + $ref: '#/components/schemas/NestedBigIntFilter' + _max: + $ref: '#/components/schemas/NestedBigIntFilter' + DateTimeWithAggregatesFilter: + type: object + properties: + equals: + type: string + format: date-time + in: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + notIn: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + lt: + type: string + format: date-time + lte: + type: string + format: date-time + gt: + type: string + format: date-time + gte: + type: string + format: date-time + not: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedDateTimeFilter' + _max: + $ref: '#/components/schemas/NestedDateTimeFilter' + FloatWithAggregatesFilter: + type: object + properties: + equals: + type: number + in: + oneOf: + - type: array + items: + type: number + - type: number + notIn: + oneOf: + - type: array + items: + type: number + - type: number + lt: + type: number + lte: + type: number + gt: + type: number + gte: + type: number + not: + oneOf: + - type: number + - $ref: '#/components/schemas/NestedFloatWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _avg: + $ref: '#/components/schemas/NestedFloatFilter' + _sum: + $ref: '#/components/schemas/NestedFloatFilter' + _min: + $ref: '#/components/schemas/NestedFloatFilter' + _max: + $ref: '#/components/schemas/NestedFloatFilter' + DecimalWithAggregatesFilter: + type: object + properties: + equals: + oneOf: + - type: string + - type: number + in: + oneOf: + - type: array + items: + oneOf: + - type: string + - type: number + - oneOf: + - type: string + - type: number + notIn: + oneOf: + - type: array + items: + oneOf: + - type: string + - type: number + - oneOf: + - type: string + - type: number + lt: + oneOf: + - type: string + - type: number + lte: + oneOf: + - type: string + - type: number + gt: + oneOf: + - type: string + - type: number + gte: + oneOf: + - type: string + - type: number + not: + oneOf: + - oneOf: + - type: string + - type: number + - $ref: '#/components/schemas/NestedDecimalWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _avg: + $ref: '#/components/schemas/NestedDecimalFilter' + _sum: + $ref: '#/components/schemas/NestedDecimalFilter' + _min: + $ref: '#/components/schemas/NestedDecimalFilter' + _max: + $ref: '#/components/schemas/NestedDecimalFilter' + BoolWithAggregatesFilter: + type: object + properties: + equals: + type: boolean + not: + oneOf: + - type: boolean + - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedBoolFilter' + _max: + $ref: '#/components/schemas/NestedBoolFilter' + BytesNullableWithAggregatesFilter: + type: object + properties: + equals: + oneOf: + - type: 'null' + - type: string + format: byte + in: + oneOf: + - type: array + items: + type: string + format: byte + - type: string + format: byte + - type: 'null' + notIn: + oneOf: + - type: array + items: + type: string + format: byte + - type: string + format: byte + - type: 'null' + not: + oneOf: + - type: string + format: byte + - $ref: '#/components/schemas/NestedBytesNullableWithAggregatesFilter' + - type: 'null' + _count: + $ref: '#/components/schemas/NestedIntNullableFilter' + _min: + $ref: '#/components/schemas/NestedBytesNullableFilter' + _max: + $ref: '#/components/schemas/NestedBytesNullableFilter' + StringFieldUpdateOperationsInput: + type: object + properties: + set: + type: string + IntFieldUpdateOperationsInput: + type: object + properties: + set: + type: integer + increment: + type: integer + decrement: + type: integer + multiply: + type: integer + divide: + type: integer + BigIntFieldUpdateOperationsInput: + type: object + properties: + set: + type: integer + increment: + type: integer + decrement: + type: integer + multiply: + type: integer + divide: + type: integer + DateTimeFieldUpdateOperationsInput: + type: object + properties: + set: + type: string + format: date-time + FloatFieldUpdateOperationsInput: + type: object + properties: + set: + type: number + increment: + type: number + decrement: + type: number + multiply: + type: number + divide: + type: number + DecimalFieldUpdateOperationsInput: + type: object + properties: + set: + oneOf: + - type: string + - type: number + increment: + oneOf: + - type: string + - type: number + decrement: + oneOf: + - type: string + - type: number + multiply: + oneOf: + - type: string + - type: number + divide: + oneOf: + - type: string + - type: number + BoolFieldUpdateOperationsInput: + type: object + properties: + set: + type: boolean + NullableBytesFieldUpdateOperationsInput: + type: object + properties: + set: + oneOf: + - type: 'null' + - type: string + format: byte + NestedStringFilter: + type: object + properties: + equals: + type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + notIn: + oneOf: + - type: array + items: + type: string + - type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringFilter' + NestedIntFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntFilter' + NestedBigIntFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedBigIntFilter' + NestedDateTimeFilter: + type: object + properties: + equals: + type: string + format: date-time + in: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + notIn: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + lt: + type: string + format: date-time + lte: + type: string + format: date-time + gt: + type: string + format: date-time + gte: + type: string + format: date-time + not: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/NestedDateTimeFilter' + NestedFloatFilter: + type: object + properties: + equals: + type: number + in: + oneOf: + - type: array + items: + type: number + - type: number + notIn: + oneOf: + - type: array + items: + type: number + - type: number + lt: + type: number + lte: + type: number + gt: + type: number + gte: + type: number + not: + oneOf: + - type: number + - $ref: '#/components/schemas/NestedFloatFilter' + NestedDecimalFilter: + type: object + properties: + equals: + oneOf: + - type: string + - type: number + in: + oneOf: + - type: array + items: + oneOf: + - type: string + - type: number + - oneOf: + - type: string + - type: number + notIn: + oneOf: + - type: array + items: + oneOf: + - type: string + - type: number + - oneOf: + - type: string + - type: number + lt: + oneOf: + - type: string + - type: number + lte: + oneOf: + - type: string + - type: number + gt: + oneOf: + - type: string + - type: number + gte: + oneOf: + - type: string + - type: number + not: + oneOf: + - oneOf: + - type: string + - type: number + - $ref: '#/components/schemas/NestedDecimalFilter' + NestedBoolFilter: + type: object + properties: + equals: + type: boolean + not: + oneOf: + - type: boolean + - $ref: '#/components/schemas/NestedBoolFilter' + NestedBytesNullableFilter: + type: object + properties: + equals: + oneOf: + - type: 'null' + - type: string + format: byte + in: + oneOf: + - type: array + items: + type: string + format: byte + - type: string + format: byte + - type: 'null' + notIn: + oneOf: + - type: array + items: + type: string + format: byte + - type: string + format: byte + - type: 'null' + not: + oneOf: + - type: string + format: byte + - $ref: '#/components/schemas/NestedBytesNullableFilter' + - type: 'null' + NestedStringWithAggregatesFilter: + type: object + properties: + equals: + type: string + in: + oneOf: + - type: array + items: + type: string + - type: string + notIn: + oneOf: + - type: array + items: + type: string + - type: string + lt: + type: string + lte: + type: string + gt: + type: string + gte: + type: string + contains: + type: string + startsWith: + type: string + endsWith: + type: string + not: + oneOf: + - type: string + - $ref: '#/components/schemas/NestedStringWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedStringFilter' + _max: + $ref: '#/components/schemas/NestedStringFilter' + NestedIntWithAggregatesFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _avg: + $ref: '#/components/schemas/NestedFloatFilter' + _sum: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedIntFilter' + _max: + $ref: '#/components/schemas/NestedIntFilter' + NestedBigIntWithAggregatesFilter: + type: object + properties: + equals: + type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedBigIntWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _avg: + $ref: '#/components/schemas/NestedFloatFilter' + _sum: + $ref: '#/components/schemas/NestedBigIntFilter' + _min: + $ref: '#/components/schemas/NestedBigIntFilter' + _max: + $ref: '#/components/schemas/NestedBigIntFilter' + NestedDateTimeWithAggregatesFilter: + type: object + properties: + equals: + type: string + format: date-time + in: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + notIn: + oneOf: + - type: array + items: + type: string + format: date-time + - type: string + format: date-time + lt: + type: string + format: date-time + lte: + type: string + format: date-time + gt: + type: string + format: date-time + gte: + type: string + format: date-time + not: + oneOf: + - type: string + format: date-time + - $ref: '#/components/schemas/NestedDateTimeWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedDateTimeFilter' + _max: + $ref: '#/components/schemas/NestedDateTimeFilter' + NestedFloatWithAggregatesFilter: + type: object + properties: + equals: + type: number + in: + oneOf: + - type: array + items: + type: number + - type: number + notIn: + oneOf: + - type: array + items: + type: number + - type: number + lt: + type: number + lte: + type: number + gt: + type: number + gte: + type: number + not: + oneOf: + - type: number + - $ref: '#/components/schemas/NestedFloatWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _avg: + $ref: '#/components/schemas/NestedFloatFilter' + _sum: + $ref: '#/components/schemas/NestedFloatFilter' + _min: + $ref: '#/components/schemas/NestedFloatFilter' + _max: + $ref: '#/components/schemas/NestedFloatFilter' + NestedDecimalWithAggregatesFilter: + type: object + properties: + equals: + oneOf: + - type: string + - type: number + in: + oneOf: + - type: array + items: + oneOf: + - type: string + - type: number + - oneOf: + - type: string + - type: number + notIn: + oneOf: + - type: array + items: + oneOf: + - type: string + - type: number + - oneOf: + - type: string + - type: number + lt: + oneOf: + - type: string + - type: number + lte: + oneOf: + - type: string + - type: number + gt: + oneOf: + - type: string + - type: number + gte: + oneOf: + - type: string + - type: number + not: + oneOf: + - oneOf: + - type: string + - type: number + - $ref: '#/components/schemas/NestedDecimalWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _avg: + $ref: '#/components/schemas/NestedDecimalFilter' + _sum: + $ref: '#/components/schemas/NestedDecimalFilter' + _min: + $ref: '#/components/schemas/NestedDecimalFilter' + _max: + $ref: '#/components/schemas/NestedDecimalFilter' + NestedBoolWithAggregatesFilter: + type: object + properties: + equals: + type: boolean + not: + oneOf: + - type: boolean + - $ref: '#/components/schemas/NestedBoolWithAggregatesFilter' + _count: + $ref: '#/components/schemas/NestedIntFilter' + _min: + $ref: '#/components/schemas/NestedBoolFilter' + _max: + $ref: '#/components/schemas/NestedBoolFilter' + NestedBytesNullableWithAggregatesFilter: + type: object + properties: + equals: + oneOf: + - type: 'null' + - type: string + format: byte + in: + oneOf: + - type: array + items: + type: string + format: byte + - type: string + format: byte + - type: 'null' + notIn: + oneOf: + - type: array + items: + type: string + format: byte + - type: string + format: byte + - type: 'null' + not: + oneOf: + - type: string + format: byte + - $ref: '#/components/schemas/NestedBytesNullableWithAggregatesFilter' + - type: 'null' + _count: + $ref: '#/components/schemas/NestedIntNullableFilter' + _min: + $ref: '#/components/schemas/NestedBytesNullableFilter' + _max: + $ref: '#/components/schemas/NestedBytesNullableFilter' + NestedIntNullableFilter: + type: object + properties: + equals: + oneOf: + - type: 'null' + - type: integer + in: + oneOf: + - type: array + items: + type: integer + - type: integer + - type: 'null' + notIn: + oneOf: + - type: array + items: + type: integer + - type: integer + - type: 'null' + lt: + type: integer + lte: + type: integer + gt: + type: integer + gte: + type: integer + not: + oneOf: + - type: integer + - $ref: '#/components/schemas/NestedIntNullableFilter' + - type: 'null' + FooSelect: + type: object + properties: + id: + type: boolean + string: + type: boolean + int: + type: boolean + bigInt: + type: boolean + date: + type: boolean + float: + type: boolean + decimal: + type: boolean + boolean: + type: boolean + bytes: + type: boolean + FooCountAggregateInput: + type: object + properties: + id: + type: boolean + string: + type: boolean + int: + type: boolean + bigInt: + type: boolean + date: + type: boolean + float: + type: boolean + decimal: + type: boolean + boolean: + type: boolean + bytes: + type: boolean + _all: + type: boolean + FooAvgAggregateInput: + type: object + properties: + int: + type: boolean + bigInt: + type: boolean + float: + type: boolean + decimal: + type: boolean + FooSumAggregateInput: + type: object + properties: + int: + type: boolean + bigInt: + type: boolean + float: + type: boolean + decimal: + type: boolean + FooMinAggregateInput: + type: object + properties: + id: + type: boolean + string: + type: boolean + int: + type: boolean + bigInt: + type: boolean + date: + type: boolean + float: + type: boolean + decimal: + type: boolean + boolean: + type: boolean + bytes: + type: boolean + FooMaxAggregateInput: + type: object + properties: + id: + type: boolean + string: + type: boolean + int: + type: boolean + bigInt: + type: boolean + date: + type: boolean + float: + type: boolean + decimal: + type: boolean + boolean: + type: boolean + bytes: + type: boolean + AggregateFoo: + type: object + properties: + _count: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/FooCountAggregateOutputType' + _avg: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/FooAvgAggregateOutputType' + _sum: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/FooSumAggregateOutputType' + _min: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/FooMinAggregateOutputType' + _max: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/FooMaxAggregateOutputType' + FooGroupByOutputType: + type: object + properties: + id: + type: string + string: + type: string + int: + type: integer + bigInt: + type: integer + date: + type: string + format: date-time + float: + type: number + decimal: + oneOf: + - type: string + - type: number + boolean: + type: boolean + bytes: + oneOf: + - type: 'null' + - type: string + format: byte + _count: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/FooCountAggregateOutputType' + _avg: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/FooAvgAggregateOutputType' + _sum: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/FooSumAggregateOutputType' + _min: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/FooMinAggregateOutputType' + _max: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/FooMaxAggregateOutputType' + required: + - id + - string + - int + - bigInt + - date + - float + - decimal + - boolean + FooCountAggregateOutputType: + type: object + properties: + id: + type: integer + string: + type: integer + int: + type: integer + bigInt: + type: integer + date: + type: integer + float: + type: integer + decimal: + type: integer + boolean: + type: integer + bytes: + type: integer + _all: + type: integer + required: + - id + - string + - int + - bigInt + - date + - float + - decimal + - boolean + - bytes + - _all + FooAvgAggregateOutputType: + type: object + properties: + int: + oneOf: + - type: 'null' + - type: number + bigInt: + oneOf: + - type: 'null' + - type: number + float: + oneOf: + - type: 'null' + - type: number + decimal: + oneOf: + - type: string + - type: number + - type: 'null' + FooSumAggregateOutputType: + type: object + properties: + int: + oneOf: + - type: 'null' + - type: integer + bigInt: + oneOf: + - type: 'null' + - type: integer + float: + oneOf: + - type: 'null' + - type: number + decimal: + oneOf: + - type: string + - type: number + - type: 'null' + FooMinAggregateOutputType: + type: object + properties: + id: + oneOf: + - type: 'null' + - type: string + string: + oneOf: + - type: 'null' + - type: string + int: + oneOf: + - type: 'null' + - type: integer + bigInt: + oneOf: + - type: 'null' + - type: integer + date: + oneOf: + - type: 'null' + - type: string + format: date-time + float: + oneOf: + - type: 'null' + - type: number + decimal: + oneOf: + - type: string + - type: number + - type: 'null' + boolean: + oneOf: + - type: 'null' + - type: boolean + bytes: + oneOf: + - type: 'null' + - type: string + format: byte + FooMaxAggregateOutputType: + type: object + properties: + id: + oneOf: + - type: 'null' + - type: string + string: + oneOf: + - type: 'null' + - type: string + int: + oneOf: + - type: 'null' + - type: integer + bigInt: + oneOf: + - type: 'null' + - type: integer + date: + oneOf: + - type: 'null' + - type: string + format: date-time + float: + oneOf: + - type: 'null' + - type: number + decimal: + oneOf: + - type: string + - type: number + - type: 'null' + boolean: + oneOf: + - type: 'null' + - type: boolean + bytes: + oneOf: + - type: 'null' + - type: string + format: byte + _Meta: + type: object + properties: + meta: + type: object + description: Meta information about the request or response + properties: + serialization: + description: Serialization metadata + additionalProperties: true + _Error: + type: object + required: + - error + properties: + error: + type: object + required: + - message + properties: + prisma: + type: boolean + description: Indicates if the error occurred during a Prisma call + rejectedByPolicy: + type: boolean + description: Indicates if the error was due to rejection by a policy + code: + type: string + description: Prisma error code. Only available when "prisma" field is true. + message: + type: string + description: Error message + reason: + type: string + description: Detailed error reason + zodErrors: + type: object + additionalProperties: true + description: Zod validation errors if the error is due to data validation + failure + additionalProperties: true + BatchPayload: + type: object + properties: + count: + type: integer + FooCreateArgs: + type: object + required: + - data + properties: + select: + $ref: '#/components/schemas/FooSelect' + data: + $ref: '#/components/schemas/FooCreateInput' + meta: + $ref: '#/components/schemas/_Meta' + FooCreateManyArgs: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/FooCreateManyInput' + meta: + $ref: '#/components/schemas/_Meta' + FooFindUniqueArgs: + type: object + required: + - where + properties: + select: + $ref: '#/components/schemas/FooSelect' + where: + $ref: '#/components/schemas/FooWhereUniqueInput' + meta: + $ref: '#/components/schemas/_Meta' + FooFindFirstArgs: + type: object + properties: + select: + $ref: '#/components/schemas/FooSelect' + where: + $ref: '#/components/schemas/FooWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + FooFindManyArgs: + type: object + properties: + select: + $ref: '#/components/schemas/FooSelect' + where: + $ref: '#/components/schemas/FooWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + FooUpdateArgs: + type: object + required: + - where + - data + properties: + select: + $ref: '#/components/schemas/FooSelect' + where: + $ref: '#/components/schemas/FooWhereUniqueInput' + data: + $ref: '#/components/schemas/FooUpdateInput' + meta: + $ref: '#/components/schemas/_Meta' + FooUpdateManyArgs: + type: object + required: + - data + properties: + where: + $ref: '#/components/schemas/FooWhereInput' + data: + $ref: '#/components/schemas/FooUpdateManyMutationInput' + meta: + $ref: '#/components/schemas/_Meta' + FooUpsertArgs: + type: object + required: + - create + - update + - where + properties: + select: + $ref: '#/components/schemas/FooSelect' + where: + $ref: '#/components/schemas/FooWhereUniqueInput' + create: + $ref: '#/components/schemas/FooCreateInput' + update: + $ref: '#/components/schemas/FooUpdateInput' + meta: + $ref: '#/components/schemas/_Meta' + FooDeleteUniqueArgs: + type: object + required: + - where + properties: + select: + $ref: '#/components/schemas/FooSelect' + where: + $ref: '#/components/schemas/FooWhereUniqueInput' + meta: + $ref: '#/components/schemas/_Meta' + FooDeleteManyArgs: + type: object + properties: + where: + $ref: '#/components/schemas/FooWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + FooCountArgs: + type: object + properties: + select: + $ref: '#/components/schemas/FooSelect' + where: + $ref: '#/components/schemas/FooWhereInput' + meta: + $ref: '#/components/schemas/_Meta' + FooAggregateArgs: + type: object + properties: + where: + $ref: '#/components/schemas/FooWhereInput' + orderBy: + $ref: '#/components/schemas/FooOrderByWithRelationInput' + cursor: + $ref: '#/components/schemas/FooWhereUniqueInput' + take: + type: integer + skip: + type: integer + _count: + oneOf: + - type: boolean + - $ref: '#/components/schemas/FooCountAggregateInput' + _min: + $ref: '#/components/schemas/FooMinAggregateInput' + _max: + $ref: '#/components/schemas/FooMaxAggregateInput' + _sum: + $ref: '#/components/schemas/FooSumAggregateInput' + _avg: + $ref: '#/components/schemas/FooAvgAggregateInput' + meta: + $ref: '#/components/schemas/_Meta' + FooGroupByArgs: + type: object + properties: + where: + $ref: '#/components/schemas/FooWhereInput' + orderBy: + $ref: '#/components/schemas/FooOrderByWithRelationInput' + by: + $ref: '#/components/schemas/FooScalarFieldEnum' + having: + $ref: '#/components/schemas/FooScalarWhereWithAggregatesInput' + take: + type: integer + skip: + type: integer + _count: + oneOf: + - type: boolean + - $ref: '#/components/schemas/FooCountAggregateInput' + _min: + $ref: '#/components/schemas/FooMinAggregateInput' + _max: + $ref: '#/components/schemas/FooMaxAggregateInput' + _sum: + $ref: '#/components/schemas/FooSumAggregateInput' + _avg: + $ref: '#/components/schemas/FooAvgAggregateInput' + meta: + $ref: '#/components/schemas/_Meta' +paths: + /foo/create: + post: + operationId: createFoo + description: Create a new Foo + tags: + - foo + security: [] + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Foo' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FooCreateArgs' + /foo/createMany: + post: + operationId: createManyFoo + description: Create several Foo + tags: + - foo + security: [] + responses: + '201': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FooCreateManyArgs' + /foo/findUnique: + get: + operationId: findUniqueFoo + description: Find one unique Foo + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Foo' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/FooFindUniqueArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /foo/findFirst: + get: + operationId: findFirstFoo + description: Find the first Foo matching the given condition + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Foo' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/FooFindFirstArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /foo/findMany: + get: + operationId: findManyFoo + description: Find a list of Foo + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/Foo' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/FooFindManyArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /foo/update: + patch: + operationId: updateFoo + description: Update a Foo + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Foo' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FooUpdateArgs' + /foo/updateMany: + patch: + operationId: updateManyFoo + description: Update Foos matching the given condition + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FooUpdateManyArgs' + /foo/upsert: + post: + operationId: upsertFoo + description: Upsert a Foo + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Foo' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FooUpsertArgs' + /foo/delete: + delete: + operationId: deleteFoo + description: Delete one unique Foo + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Foo' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/FooDeleteUniqueArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /foo/deleteMany: + delete: + operationId: deleteManyFoo + description: Delete Foos matching the given condition + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/BatchPayload' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/FooDeleteManyArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /foo/count: + get: + operationId: countFoo + description: Find a list of Foo + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + oneOf: + - type: integer + - $ref: '#/components/schemas/FooCountAggregateOutputType' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/FooCountArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /foo/aggregate: + get: + operationId: aggregateFoo + description: Aggregate Foos + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/AggregateFoo' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/FooAggregateArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} + /foo/groupBy: + get: + operationId: groupByFoo + description: Group Foos by fields + tags: + - foo + security: [] + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/FooGroupByOutputType' + description: The Prisma response data serialized with superjson + meta: + $ref: '#/components/schemas/_Meta' + description: The superjson serialization metadata for the "data" field + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Invalid request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/_Error' + description: Request is forbidden + parameters: + - name: q + in: query + required: true + description: Superjson-serialized Prisma query object + content: + application/json: + schema: + $ref: '#/components/schemas/FooGroupByArgs' + - name: meta + in: query + description: Superjson serialization metadata for parameter "q" + content: + application/json: + schema: {} diff --git a/packages/plugins/openapi/tests/openapi-restful.test.ts b/packages/plugins/openapi/tests/openapi-restful.test.ts index 77d13885a..fb01e390e 100644 --- a/packages/plugins/openapi/tests/openapi-restful.test.ts +++ b/packages/plugins/openapi/tests/openapi-restful.test.ts @@ -3,18 +3,21 @@ import OpenAPIParser from '@readme/openapi-parser'; import { getLiteral, getObjectLiteral } from '@zenstackhq/sdk'; -import { isPlugin, Model, Plugin } from '@zenstackhq/sdk/ast'; +import { Model, Plugin, isPlugin } from '@zenstackhq/sdk/ast'; import { loadZModelAndDmmf } from '@zenstackhq/testtools'; -import * as fs from 'fs'; +import fs from 'fs'; +import path from 'path'; import * as tmp from 'tmp'; import YAML from 'yaml'; import generate from '../src'; -describe('Open API Plugin Tests', () => { +describe('Open API Plugin RESTful Tests', () => { it('run plugin', async () => { - const { model, dmmf, modelFile } = await loadZModelAndDmmf(` + for (const specVersion of ['3.0.0', '3.1.0']) { + const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' + specVersion = '${specVersion}' } enum role { @@ -29,6 +32,15 @@ model User { email String @unique role role @default(USER) posts post_Item[] + profile Profile? +} + +model Profile { + id String @id @default(cuid()) + image String? + + user User @relation(fields: [userId], references: [id]) + userId String @unique } model post_Item { @@ -40,6 +52,7 @@ model post_Item { authorId String? published Boolean @default(false) viewCount Int @default(0) + notes String? @@openapi.meta({ tagDescription: 'Post-related operations' @@ -57,48 +70,51 @@ model Bar { } `); - const { name: output } = tmp.fileSync({ postfix: '.yaml' }); - - const options = buildOptions(model, modelFile, output, '3.1.0'); - await generate(model, options, dmmf); - - console.log('OpenAPI specification generated:', output); - - const api = await OpenAPIParser.validate(output); - - expect(api.tags).toEqual( - expect.arrayContaining([ - expect.objectContaining({ name: 'user', description: 'User operations' }), - expect.objectContaining({ name: 'post_Item', description: 'Post-related operations' }), - ]) - ); - - expect(api.paths?.['/user']?.['get']).toBeTruthy(); - expect(api.paths?.['/user']?.['post']).toBeTruthy(); - expect(api.paths?.['/user']?.['put']).toBeFalsy(); - expect(api.paths?.['/user/{id}']?.['get']).toBeTruthy(); - expect(api.paths?.['/user/{id}']?.['patch']).toBeTruthy(); - expect(api.paths?.['/user/{id}']?.['delete']).toBeTruthy(); - expect(api.paths?.['/user/{id}/posts']?.['get']).toBeTruthy(); - expect(api.paths?.['/user/{id}/relationships/posts']?.['get']).toBeTruthy(); - expect(api.paths?.['/user/{id}/relationships/posts']?.['post']).toBeTruthy(); - expect(api.paths?.['/user/{id}/relationships/posts']?.['patch']).toBeTruthy(); - expect(api.paths?.['/post_Item/{id}/relationships/author']?.['get']).toBeTruthy(); - expect(api.paths?.['/post_Item/{id}/relationships/author']?.['post']).toBeUndefined(); - expect(api.paths?.['/post_Item/{id}/relationships/author']?.['patch']).toBeTruthy(); - expect(api.paths?.['/foo']).toBeUndefined(); - expect(api.paths?.['/bar']).toBeUndefined(); - - const parsed = YAML.parse(fs.readFileSync(output, 'utf-8')); - expect(parsed.openapi).toBe('3.1.0'); - const baseline = YAML.parse(fs.readFileSync(`${__dirname}/baseline/rest.baseline.yaml`, 'utf-8')); - expect(parsed).toMatchObject(baseline); + const { name: output } = tmp.fileSync({ postfix: '.yaml' }); + + const options = buildOptions(model, modelFile, output, '3.1.0'); + await generate(model, options, dmmf); + + console.log(`OpenAPI specification generated for ${specVersion}: ${output}`); + + const api = await OpenAPIParser.validate(output); + + expect(api.tags).toEqual( + expect.arrayContaining([ + expect.objectContaining({ name: 'user', description: 'User operations' }), + expect.objectContaining({ name: 'post_Item', description: 'Post-related operations' }), + ]) + ); + + expect(api.paths?.['/user']?.['get']).toBeTruthy(); + expect(api.paths?.['/user']?.['post']).toBeTruthy(); + expect(api.paths?.['/user']?.['put']).toBeFalsy(); + expect(api.paths?.['/user/{id}']?.['get']).toBeTruthy(); + expect(api.paths?.['/user/{id}']?.['patch']).toBeTruthy(); + expect(api.paths?.['/user/{id}']?.['delete']).toBeTruthy(); + expect(api.paths?.['/user/{id}/posts']?.['get']).toBeTruthy(); + expect(api.paths?.['/user/{id}/relationships/posts']?.['get']).toBeTruthy(); + expect(api.paths?.['/user/{id}/relationships/posts']?.['post']).toBeTruthy(); + expect(api.paths?.['/user/{id}/relationships/posts']?.['patch']).toBeTruthy(); + expect(api.paths?.['/post_Item/{id}/relationships/author']?.['get']).toBeTruthy(); + expect(api.paths?.['/post_Item/{id}/relationships/author']?.['post']).toBeUndefined(); + expect(api.paths?.['/post_Item/{id}/relationships/author']?.['patch']).toBeTruthy(); + expect(api.paths?.['/foo']).toBeUndefined(); + expect(api.paths?.['/bar']).toBeUndefined(); + + const parsed = YAML.parse(fs.readFileSync(output, 'utf-8')); + expect(parsed.openapi).toBe(specVersion); + const baseline = YAML.parse( + fs.readFileSync(`${__dirname}/baseline/rest-${specVersion}.baseline.yaml`, 'utf-8') + ); + expect(parsed).toMatchObject(baseline); + } }); it('options', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' specVersion = '3.0.0' title = 'My Awesome API' version = '1.0.0' @@ -135,7 +151,7 @@ model User { it('security schemes valid', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' securitySchemes = { myBasic: { type: 'http', scheme: 'basic' }, myBearer: { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' }, @@ -182,7 +198,7 @@ model Post { it('security model level override', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' securitySchemes = { myBasic: { type: 'http', scheme: 'basic' } } @@ -214,7 +230,7 @@ model User { it('security schemes invalid', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' securitySchemes = { myBasic: { type: 'invalid', scheme: 'basic' } } @@ -235,7 +251,7 @@ model User { it('ignored model used as relation', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' } model User { @@ -265,9 +281,11 @@ model Post { }); it('field type coverage', async () => { - const { model, dmmf, modelFile } = await loadZModelAndDmmf(` + for (const specVersion of ['3.0.0', '3.1.0']) { + const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' + specVersion = '${specVersion}' } model Foo { @@ -286,19 +304,22 @@ model Foo { } `); - const { name: output } = tmp.fileSync({ postfix: '.yaml' }); + const { name: output } = tmp.fileSync({ postfix: '.yaml' }); - const options = buildOptions(model, modelFile, output, '3.1.0'); - await generate(model, options, dmmf); + const options = buildOptions(model, modelFile, output, '3.1.0'); + await generate(model, options, dmmf); - console.log('OpenAPI specification generated:', output); + console.log(`OpenAPI specification generated for ${specVersion}: ${output}`); - await OpenAPIParser.validate(output); + await OpenAPIParser.validate(output); - const parsed = YAML.parse(fs.readFileSync(output, 'utf-8')); - expect(parsed.openapi).toBe('3.1.0'); - const baseline = YAML.parse(fs.readFileSync(`${__dirname}/baseline/rest-type-coverage.baseline.yaml`, 'utf-8')); - expect(parsed).toMatchObject(baseline); + const parsed = YAML.parse(fs.readFileSync(output, 'utf-8')); + expect(parsed.openapi).toBe(specVersion); + const baseline = YAML.parse( + fs.readFileSync(`${__dirname}/baseline/rest-type-coverage-${specVersion}.baseline.yaml`, 'utf-8') + ); + expect(parsed).toMatchObject(baseline); + } }); }); diff --git a/packages/plugins/openapi/tests/openapi-rpc.test.ts b/packages/plugins/openapi/tests/openapi-rpc.test.ts index 90d63e59e..c0cb74ab6 100644 --- a/packages/plugins/openapi/tests/openapi-rpc.test.ts +++ b/packages/plugins/openapi/tests/openapi-rpc.test.ts @@ -3,18 +3,21 @@ import OpenAPIParser from '@readme/openapi-parser'; import { getLiteral, getObjectLiteral } from '@zenstackhq/sdk'; -import { isPlugin, Model, Plugin } from '@zenstackhq/sdk/ast'; +import { Model, Plugin, isPlugin } from '@zenstackhq/sdk/ast'; import { loadZModelAndDmmf } from '@zenstackhq/testtools'; -import * as fs from 'fs'; +import fs from 'fs'; +import path from 'path'; import * as tmp from 'tmp'; import YAML from 'yaml'; import generate from '../src'; -describe('Open API Plugin Tests', () => { +describe('Open API Plugin RPC Tests', () => { it('run plugin', async () => { - const { model, dmmf, modelFile } = await loadZModelAndDmmf(` + for (const specVersion of ['3.0.0', '3.1.0']) { + const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' + specVersion = '${specVersion}' } enum role { @@ -29,6 +32,7 @@ model User { email String @unique role role @default(USER) posts post_Item[] + profile Profile? @@openapi.meta({ findMany: { @@ -45,6 +49,14 @@ model User { }) } +model Profile { + id String @id @default(cuid()) + image String? + + user User @relation(fields: [userId], references: [id]) + userId String @unique +} + model post_Item { id String @id createdAt DateTime @default(now()) @@ -54,6 +66,7 @@ model post_Item { authorId String? published Boolean @default(false) viewCount Int @default(0) + notes String? @@openapi.meta({ tagDescription: 'Post-related operations', @@ -74,42 +87,47 @@ model Bar { } `); - const { name: output } = tmp.fileSync({ postfix: '.yaml' }); - - const options = buildOptions(model, modelFile, output); - await generate(model, options, dmmf); - - console.log('OpenAPI specification generated:', output); - - const parsed = YAML.parse(fs.readFileSync(output, 'utf-8')); - expect(parsed.openapi).toBe('3.1.0'); - const baseline = YAML.parse(fs.readFileSync(`${__dirname}/baseline/rpc.baseline.yaml`, 'utf-8')); - expect(parsed).toMatchObject(baseline); - - const api = await OpenAPIParser.validate(output); - - expect(api.tags).toEqual( - expect.arrayContaining([ - expect.objectContaining({ name: 'user', description: 'User operations' }), - expect.objectContaining({ name: 'post_Item', description: 'Post-related operations' }), - ]) - ); - - expect(api.paths?.['/user/findMany']?.['get']?.description).toBe('Find users matching the given conditions'); - const del = api.paths?.['/user/dodelete']?.['put']; - expect(del?.description).toBe('Delete a unique user'); - expect(del?.summary).toBe('Delete a user yeah yeah'); - expect(del?.tags).toEqual(expect.arrayContaining(['delete', 'user'])); - expect(del?.deprecated).toBe(true); - expect(api.paths?.['/post/findMany']).toBeUndefined(); - expect(api.paths?.['/foo/findMany']).toBeUndefined(); - expect(api.paths?.['/bar/findMany']).toBeUndefined(); + const { name: output } = tmp.fileSync({ postfix: '.yaml' }); + + const options = buildOptions(model, modelFile, output); + await generate(model, options, dmmf); + + console.log(`OpenAPI specification generated for ${specVersion}: ${output}`); + + const parsed = YAML.parse(fs.readFileSync(output, 'utf-8')); + expect(parsed.openapi).toBe(specVersion); + const baseline = YAML.parse( + fs.readFileSync(`${__dirname}/baseline/rpc-${specVersion}.baseline.yaml`, 'utf-8') + ); + expect(parsed).toMatchObject(baseline); + + const api = await OpenAPIParser.validate(output); + + expect(api.tags).toEqual( + expect.arrayContaining([ + expect.objectContaining({ name: 'user', description: 'User operations' }), + expect.objectContaining({ name: 'post_Item', description: 'Post-related operations' }), + ]) + ); + + expect(api.paths?.['/user/findMany']?.['get']?.description).toBe( + 'Find users matching the given conditions' + ); + const del = api.paths?.['/user/dodelete']?.['put']; + expect(del?.description).toBe('Delete a unique user'); + expect(del?.summary).toBe('Delete a user yeah yeah'); + expect(del?.tags).toEqual(expect.arrayContaining(['delete', 'user'])); + expect(del?.deprecated).toBe(true); + expect(api.paths?.['/post/findMany']).toBeUndefined(); + expect(api.paths?.['/foo/findMany']).toBeUndefined(); + expect(api.paths?.['/bar/findMany']).toBeUndefined(); + } }); it('options', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' specVersion = '3.0.0' title = 'My Awesome API' version = '1.0.0' @@ -146,7 +164,7 @@ model User { it('security schemes valid', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' securitySchemes = { myBasic: { type: 'http', scheme: 'basic' }, myBearer: { type: 'http', scheme: 'bearer', bearerFormat: 'JWT' }, @@ -180,7 +198,7 @@ model User { it('security schemes invalid', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' securitySchemes = { myBasic: { type: 'invalid', scheme: 'basic' } } @@ -201,7 +219,7 @@ model User { it('security model level override', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' securitySchemes = { myBasic: { type: 'http', scheme: 'basic' } } @@ -229,7 +247,7 @@ model User { it('security operation level override', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' securitySchemes = { myBasic: { type: 'http', scheme: 'basic' } } @@ -262,7 +280,7 @@ model User { it('security inferred', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' securitySchemes = { myBasic: { type: 'http', scheme: 'basic' } } @@ -288,7 +306,7 @@ model User { it('v3.1.0 fields', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' summary = 'awesome api' } @@ -312,7 +330,7 @@ model User { it('ignored model used as relation', async () => { const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' } model User { @@ -341,9 +359,11 @@ model Post { }); it('field type coverage', async () => { - const { model, dmmf, modelFile } = await loadZModelAndDmmf(` + for (const specVersion of ['3.0.0', '3.1.0']) { + const { model, dmmf, modelFile } = await loadZModelAndDmmf(` plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' + specVersion = '${specVersion}' } model Foo { @@ -356,25 +376,28 @@ model Foo { float Float decimal Decimal boolean Boolean - bytes Bytes + bytes Bytes? @@allow('all', true) } `); - const { name: output } = tmp.fileSync({ postfix: '.yaml' }); + const { name: output } = tmp.fileSync({ postfix: '.yaml' }); - const options = buildOptions(model, modelFile, output); - await generate(model, options, dmmf); + const options = buildOptions(model, modelFile, output); + await generate(model, options, dmmf); - console.log('OpenAPI specification generated:', output); + console.log(`OpenAPI specification generated for ${specVersion}: ${output}`); - await OpenAPIParser.validate(output); + await OpenAPIParser.validate(output); - const parsed = YAML.parse(fs.readFileSync(output, 'utf-8')); - expect(parsed.openapi).toBe('3.1.0'); - const baseline = YAML.parse(fs.readFileSync(`${__dirname}/baseline/rpc-type-coverage.baseline.yaml`, 'utf-8')); - expect(parsed).toMatchObject(baseline); + const parsed = YAML.parse(fs.readFileSync(output, 'utf-8')); + expect(parsed.openapi).toBe(specVersion); + const baseline = YAML.parse( + fs.readFileSync(`${__dirname}/baseline/rpc-type-coverage-${specVersion}.baseline.yaml`, 'utf-8') + ); + expect(parsed).toMatchObject(baseline); + } }); it('full-text search', async () => { @@ -385,7 +408,7 @@ generator js { } plugin openapi { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' } enum role { diff --git a/packages/plugins/swr/tests/swr.test.ts b/packages/plugins/swr/tests/swr.test.ts index fca774d64..76db29b49 100644 --- a/packages/plugins/swr/tests/swr.test.ts +++ b/packages/plugins/swr/tests/swr.test.ts @@ -1,6 +1,7 @@ /// import { loadSchema } from '@zenstackhq/testtools'; +import path from 'path'; describe('SWR Plugin Tests', () => { let origDir: string; @@ -49,7 +50,7 @@ model Foo { await loadSchema( ` plugin swr { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/hooks' } diff --git a/packages/plugins/tanstack-query/tests/plugin.test.ts b/packages/plugins/tanstack-query/tests/plugin.test.ts index 252a4c04f..49a99df94 100644 --- a/packages/plugins/tanstack-query/tests/plugin.test.ts +++ b/packages/plugins/tanstack-query/tests/plugin.test.ts @@ -1,6 +1,7 @@ /// import { loadSchema } from '@zenstackhq/testtools'; +import path from 'path'; describe('Tanstack Query Plugin Tests', () => { let origDir: string; @@ -49,7 +50,7 @@ model Foo { await loadSchema( ` plugin tanstack { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/hooks' target = 'react' } @@ -70,7 +71,7 @@ ${sharedModel} await loadSchema( ` plugin tanstack { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/hooks' target = 'react' version = 'v5' @@ -92,7 +93,7 @@ ${sharedModel} await loadSchema( ` plugin tanstack { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/hooks' target = 'vue' } @@ -113,7 +114,7 @@ ${sharedModel} await loadSchema( ` plugin tanstack { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/hooks' target = 'vue' version = 'v5' @@ -135,7 +136,7 @@ ${sharedModel} await loadSchema( ` plugin tanstack { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/hooks' target = 'svelte' } @@ -156,7 +157,7 @@ ${sharedModel} await loadSchema( ` plugin tanstack { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/hooks' target = 'svelte' version = 'v5' diff --git a/packages/plugins/trpc/tests/trpc.test.ts b/packages/plugins/trpc/tests/trpc.test.ts index 251ac3d14..cf43c9a49 100644 --- a/packages/plugins/trpc/tests/trpc.test.ts +++ b/packages/plugins/trpc/tests/trpc.test.ts @@ -19,7 +19,7 @@ describe('tRPC Plugin Tests', () => { await loadSchema( ` plugin trpc { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/trpc' } @@ -67,7 +67,7 @@ model Foo { const { projectDir } = await loadSchema( ` plugin trpc { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = './trpc' } @@ -110,7 +110,7 @@ model Foo { const { projectDir } = await loadSchema( ` plugin trpc { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = './trpc' } @@ -141,7 +141,7 @@ model Post { const { projectDir } = await loadSchema( ` plugin trpc { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = './trpc' generateModelActions = 'findMany,findUnique,update' } @@ -171,7 +171,7 @@ model Post { const { projectDir } = await loadSchema( ` plugin trpc { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = './trpc' generateModelActions = ['findMany', 'findUnique', 'update'] } @@ -220,7 +220,7 @@ model Post { await loadSchema( ` plugin trpc { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/trpc' generateClientHelpers = 'react' } @@ -240,7 +240,7 @@ model Post { await loadSchema( ` plugin trpc { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/trpc' generateClientHelpers = 'next' } @@ -260,7 +260,7 @@ model Post { await loadSchema( ` plugin trpc { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/trpc' } @@ -299,7 +299,7 @@ generator js { } plugin trpc { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/trpc' generateModels = ['Post'] generateModelActions = ['findMany', 'update'] @@ -370,7 +370,7 @@ plugin zod { } plugin trpc { - provider = '${process.cwd()}/dist' + provider = '${path.resolve(__dirname, '../dist')}' output = '$projectRoot/trpc' generateModels = ['Post'] generateModelActions = ['findMany', 'update'] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index de0f8a35f..9ddeb1f59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,9 +100,15 @@ importers: openapi-types: specifier: ^12.1.0 version: 12.1.0 + semver: + specifier: ^7.3.8 + version: 7.5.4 tiny-invariant: specifier: ^1.3.1 version: 1.3.1 + ts-pattern: + specifier: ^4.3.0 + version: 4.3.0 upper-case-first: specifier: ^2.0.2 version: 2.0.2 @@ -122,6 +128,9 @@ importers: '@types/pluralize': specifier: ^0.0.29 version: 0.0.29 + '@types/semver': + specifier: ^7.3.13 + version: 7.5.0 '@types/tmp': specifier: ^0.2.3 version: 0.2.3 @@ -7616,7 +7625,7 @@ packages: proxy-addr: 2.0.7 rfdc: 1.3.0 secure-json-parse: 2.7.0 - semver: 7.5.3 + semver: 7.5.4 tiny-lru: 10.4.1 transitivePeerDependencies: - supports-color @@ -7957,7 +7966,7 @@ packages: get-it: 8.1.4 registry-auth-token: 5.0.2 registry-url: 5.1.0 - semver: 7.5.3 + semver: 7.5.4 transitivePeerDependencies: - supports-color dev: false @@ -12297,6 +12306,7 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 + dev: false /semver@7.5.4: resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} @@ -12304,7 +12314,6 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 - dev: true /send@0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} @@ -14110,7 +14119,7 @@ packages: engines: {vscode: ^1.67.0} dependencies: minimatch: 3.1.2 - semver: 7.5.3 + semver: 7.5.4 vscode-languageserver-protocol: 3.17.2 dev: false