Value Transforms
Transform values on input/output and handle nil/empty string conversion
API Definition
config/apis/swift_fox.rb
rb
# frozen_string_literal: true
Apiwork::API.define '/swift_fox' do
key_format :camel
export :openapi
export :typescript
export :zod
resources :contacts
endModels
app/models/swift_fox/contact.rb
rb
# frozen_string_literal: true
module SwiftFox
class Contact < ApplicationRecord
validates :name, presence: true
end
endDatabase Table
| Column | Type | Nullable | Default |
|---|---|---|---|
| id | string | ||
| created_at | datetime | ||
| string | ✓ | ||
| name | string | ||
| notes | string | ✓ | |
| phone | string | ✓ | |
| updated_at | datetime |
Representations
app/representations/swift_fox/contact_representation.rb
rb
# frozen_string_literal: true
module SwiftFox
class ContactRepresentation < Apiwork::Representation::Base
attribute :id
attribute :name, writable: true
attribute :email, decode: ->(v) { v&.downcase }, encode: ->(v) { v&.downcase }, writable: true
attribute :phone, empty: true, writable: true
attribute :notes, empty: true, writable: true
attribute :created_at
attribute :updated_at
end
endContracts
app/contracts/swift_fox/contact_contract.rb
rb
# frozen_string_literal: true
module SwiftFox
class ContactContract < Apiwork::Contract::Base
representation ContactRepresentation
end
endControllers
app/controllers/swift_fox/contacts_controller.rb
rb
# frozen_string_literal: true
module SwiftFox
class ContactsController < ApplicationController
before_action :set_contact, only: %i[show update destroy]
def index
contacts = Contact.all
expose contacts
end
def show
expose contact
end
def create
contact = Contact.create(contract.body[:contact])
expose contact
end
def update
contact.update(contract.body[:contact])
expose contact
end
def destroy
contact.destroy
expose contact
end
private
attr_reader :contact
def set_contact
@contact = Contact.find(params[:id])
end
end
endRequest Examples
Create with transforms
Request
http
POST /swift_fox/contacts
Content-Type: application/json
{
"contact": {
"name": "John Doe",
"email": "John.Doe@Example.COM",
"phone": "",
"notes": ""
}
}Response 201
json
{
"contact": {
"id": "a8683ee9-6e2e-525c-84e5-103a4b4230cb",
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "",
"notes": "",
"createdAt": "2024-01-01T12:00:00.000Z",
"updatedAt": "2024-01-01T12:00:00.000Z"
}
}Show transformed data
Request
http
GET /swift_fox/contacts/a8683ee9-6e2e-525c-84e5-103a4b4230cbResponse 200
json
{
"contact": {
"id": "a8683ee9-6e2e-525c-84e5-103a4b4230cb",
"name": "Jane Doe",
"email": "jane@example.com",
"phone": "",
"notes": "",
"createdAt": "2024-01-01T12:00:00.000Z",
"updatedAt": "2024-01-01T12:00:00.000Z"
}
}Generated Output
Introspection
json
{
"base_path": "/swift_fox",
"fingerprint": "f70bea5be6982115",
"locales": [],
"enums": {
"error_layer": {
"deprecated": false,
"description": null,
"example": null,
"values": [
"http",
"contract",
"domain"
]
}
},
"error_codes": {
"unprocessable_entity": {
"description": "Unprocessable Entity",
"status": 422
}
},
"info": null,
"resources": {
"contacts": {
"actions": {
"index": {
"deprecated": false,
"description": null,
"method": "get",
"operation_id": null,
"path": "/contacts",
"raises": [],
"request": {
"description": null,
"body": {},
"query": {
"page": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "reference",
"reference": "contact_page"
}
}
},
"response": {
"description": null,
"body": {
"deprecated": null,
"description": null,
"nullable": null,
"optional": null,
"type": "object",
"partial": null,
"shape": {
"contacts": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "array",
"default": null,
"example": null,
"max": null,
"min": null,
"of": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "reference",
"reference": "contact"
},
"shape": {}
},
"meta": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "object",
"partial": false,
"shape": {}
},
"pagination": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "reference",
"reference": "offset_pagination"
}
}
},
"no_content": false
},
"summary": null,
"tags": []
},
"show": {
"deprecated": false,
"description": null,
"method": "get",
"operation_id": null,
"path": "/contacts/:id",
"raises": [],
"request": {
"description": null,
"body": {},
"query": {}
},
"response": {
"description": null,
"body": {
"deprecated": null,
"description": null,
"nullable": null,
"optional": null,
"type": "object",
"partial": null,
"shape": {
"contact": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "reference",
"reference": "contact"
},
"meta": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "object",
"partial": false,
"shape": {}
}
}
},
"no_content": false
},
"summary": null,
"tags": []
},
"create": {
"deprecated": false,
"description": null,
"method": "post",
"operation_id": null,
"path": "/contacts",
"raises": [
"unprocessable_entity"
],
"request": {
"description": null,
"body": {
"contact": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "reference",
"reference": "contact_create_payload"
}
},
"query": {}
},
"response": {
"description": null,
"body": {
"deprecated": null,
"description": null,
"nullable": null,
"optional": null,
"type": "object",
"partial": null,
"shape": {
"contact": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "reference",
"reference": "contact"
},
"meta": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "object",
"partial": false,
"shape": {}
}
}
},
"no_content": false
},
"summary": null,
"tags": []
},
"update": {
"deprecated": false,
"description": null,
"method": "patch",
"operation_id": null,
"path": "/contacts/:id",
"raises": [
"unprocessable_entity"
],
"request": {
"description": null,
"body": {
"contact": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "reference",
"reference": "contact_update_payload"
}
},
"query": {}
},
"response": {
"description": null,
"body": {
"deprecated": null,
"description": null,
"nullable": null,
"optional": null,
"type": "object",
"partial": null,
"shape": {
"contact": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "reference",
"reference": "contact"
},
"meta": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "object",
"partial": false,
"shape": {}
}
}
},
"no_content": false
},
"summary": null,
"tags": []
},
"destroy": {
"deprecated": false,
"description": null,
"method": "delete",
"operation_id": null,
"path": "/contacts/:id",
"raises": [],
"request": {
"description": null,
"body": {},
"query": {}
},
"response": {
"description": null,
"body": null,
"no_content": true
},
"summary": null,
"tags": []
}
},
"identifier": "contacts",
"parent_identifiers": [],
"path": "contacts",
"resources": {}
}
},
"types": {
"contact": {
"deprecated": false,
"description": null,
"discriminator": null,
"example": null,
"extends": [],
"shape": {
"created_at": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "datetime",
"default": null,
"example": null
},
"email": {
"deprecated": false,
"description": null,
"nullable": true,
"optional": false,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"id": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"name": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"notes": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"phone": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"updated_at": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "datetime",
"default": null,
"example": null
}
},
"type": "object",
"variants": []
},
"contact_create_payload": {
"deprecated": false,
"description": null,
"discriminator": null,
"example": null,
"extends": [],
"shape": {
"email": {
"deprecated": false,
"description": null,
"nullable": true,
"optional": true,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"name": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"notes": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "string",
"default": "",
"example": null,
"format": null,
"max": null,
"min": null
},
"phone": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "string",
"default": "",
"example": null,
"format": null,
"max": null,
"min": null
}
},
"type": "object",
"variants": []
},
"contact_page": {
"deprecated": false,
"description": null,
"discriminator": null,
"example": null,
"extends": [],
"shape": {
"number": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "integer",
"default": null,
"example": null,
"format": null,
"max": null,
"min": 1
},
"size": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "integer",
"default": null,
"example": null,
"format": null,
"max": 100,
"min": 1
}
},
"type": "object",
"variants": []
},
"contact_update_payload": {
"deprecated": false,
"description": null,
"discriminator": null,
"example": null,
"extends": [],
"shape": {
"email": {
"deprecated": false,
"description": null,
"nullable": true,
"optional": true,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"name": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"notes": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "string",
"default": "",
"example": null,
"format": null,
"max": null,
"min": null
},
"phone": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": true,
"type": "string",
"default": "",
"example": null,
"format": null,
"max": null,
"min": null
}
},
"type": "object",
"variants": []
},
"error": {
"deprecated": false,
"description": null,
"discriminator": null,
"example": null,
"extends": [],
"shape": {
"issues": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "array",
"default": null,
"example": null,
"max": null,
"min": null,
"of": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "reference",
"reference": "error_issue"
},
"shape": {}
},
"layer": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "reference",
"reference": "error_layer"
}
},
"type": "object",
"variants": []
},
"error_issue": {
"deprecated": false,
"description": null,
"discriminator": null,
"example": null,
"extends": [],
"shape": {
"code": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"detail": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"meta": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "object",
"partial": false,
"shape": {}
},
"path": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "array",
"default": null,
"example": null,
"max": null,
"min": null,
"of": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "union",
"discriminator": null,
"variants": [
{
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
{
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "integer",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
}
]
},
"shape": {}
},
"pointer": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "string",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
}
},
"type": "object",
"variants": []
},
"offset_pagination": {
"deprecated": false,
"description": null,
"discriminator": null,
"example": null,
"extends": [],
"shape": {
"current": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "integer",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"items": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "integer",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"next": {
"deprecated": false,
"description": null,
"nullable": true,
"optional": true,
"type": "integer",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"prev": {
"deprecated": false,
"description": null,
"nullable": true,
"optional": true,
"type": "integer",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
},
"total": {
"deprecated": false,
"description": null,
"nullable": false,
"optional": false,
"type": "integer",
"default": null,
"example": null,
"format": null,
"max": null,
"min": null
}
},
"type": "object",
"variants": []
}
}
}TypeScript
ts
export interface Contact {
createdAt: string;
email: null | string;
id: string;
name: string;
notes: string;
phone: string;
updatedAt: string;
}
export interface ContactCreatePayload {
email: null | string;
name: string;
notes: string;
phone: string;
}
export interface ContactPage {
number?: number;
size?: number;
}
export interface ContactUpdatePayload {
email: null | string;
name?: string;
notes: string;
phone: string;
}
export interface ContactsCreateRequest {
body: ContactsCreateRequestBody;
}
export interface ContactsCreateRequestBody {
contact: ContactCreatePayload;
}
export type ContactsCreateResponse =
| { status: 200; body: ContactsCreateResponseBody }
| { status: 422; body: Error };
export type ContactsCreateResponseBody = { contact: Contact; meta?: Record<string, unknown> };
export type ContactsDestroyResponse = { status: 204 };
export interface ContactsIndexRequest {
query: ContactsIndexRequestQuery;
}
export interface ContactsIndexRequestQuery {
page?: ContactPage;
}
export type ContactsIndexResponse = { status: 200; body: ContactsIndexResponseBody };
export type ContactsIndexResponseBody = { contacts: Contact[]; meta?: Record<string, unknown>; pagination: OffsetPagination };
export type ContactsShowResponse = { status: 200; body: ContactsShowResponseBody };
export type ContactsShowResponseBody = { contact: Contact; meta?: Record<string, unknown> };
export interface ContactsUpdateRequest {
body: ContactsUpdateRequestBody;
}
export interface ContactsUpdateRequestBody {
contact: ContactUpdatePayload;
}
export type ContactsUpdateResponse =
| { status: 200; body: ContactsUpdateResponseBody }
| { status: 422; body: Error };
export type ContactsUpdateResponseBody = { contact: Contact; meta?: Record<string, unknown> };
export interface Error {
issues: ErrorIssue[];
layer: ErrorLayer;
}
export interface ErrorIssue {
code: string;
detail: string;
meta: Record<string, unknown>;
path: (number | string)[];
pointer: string;
}
export type ErrorLayer = 'contract' | 'domain' | 'http';
export interface OffsetPagination {
current: number;
items: number;
next: null | number;
prev: null | number;
total: number;
}Zod
ts
import { z } from 'zod';
export const ErrorLayerSchema = z.enum(['contract', 'domain', 'http']);
export const ContactSchema = z.object({
createdAt: z.iso.datetime(),
email: z.string().nullable(),
id: z.string(),
name: z.string(),
notes: z.string(),
phone: z.string(),
updatedAt: z.iso.datetime()
});
export const ContactCreatePayloadSchema = z.object({
email: z.string().nullable().default(null),
name: z.string(),
notes: z.string().default(''),
phone: z.string().default('')
});
export const ContactPageSchema = z.object({
number: z.number().int().min(1).optional(),
size: z.number().int().min(1).max(100).optional()
});
export const ContactUpdatePayloadSchema = z.object({
email: z.string().nullable().default(null),
name: z.string().optional(),
notes: z.string().default(''),
phone: z.string().default('')
});
export const ErrorIssueSchema = z.object({
code: z.string(),
detail: z.string(),
meta: z.record(z.string(), z.unknown()),
path: z.array(z.union([z.string(), z.number().int()])),
pointer: z.string()
});
export const OffsetPaginationSchema = z.object({
current: z.number().int(),
items: z.number().int(),
next: z.number().int().nullable().default(null),
prev: z.number().int().nullable().default(null),
total: z.number().int()
});
export const ErrorSchema = z.object({
issues: z.array(ErrorIssueSchema),
layer: ErrorLayerSchema
});
export const ContactsIndexRequestQuerySchema = z.object({
page: ContactPageSchema.optional()
});
export const ContactsIndexRequestSchema = z.object({
query: ContactsIndexRequestQuerySchema
});
export const ContactsIndexResponseBodySchema = z.object({ contacts: z.array(ContactSchema), meta: z.record(z.string(), z.unknown()).optional(), pagination: OffsetPaginationSchema });
export const ContactsShowResponseBodySchema = z.object({ contact: ContactSchema, meta: z.record(z.string(), z.unknown()).optional() });
export const ContactsCreateRequestBodySchema = z.object({
contact: ContactCreatePayloadSchema
});
export const ContactsCreateRequestSchema = z.object({
body: ContactsCreateRequestBodySchema
});
export const ContactsCreateResponseBodySchema = z.object({ contact: ContactSchema, meta: z.record(z.string(), z.unknown()).optional() });
export const ContactsUpdateRequestBodySchema = z.object({
contact: ContactUpdatePayloadSchema
});
export const ContactsUpdateRequestSchema = z.object({
body: ContactsUpdateRequestBodySchema
});
export const ContactsUpdateResponseBodySchema = z.object({ contact: ContactSchema, meta: z.record(z.string(), z.unknown()).optional() });
export const ContactsIndexResponseSchema = z.object({ status: z.literal(200), body: ContactsIndexResponseBodySchema });
export const ContactsShowResponseSchema = z.object({ status: z.literal(200), body: ContactsShowResponseBodySchema });
export const ContactsCreateResponseSchema = z.discriminatedUnion('status', [
z.object({ status: z.literal(200), body: ContactsCreateResponseBodySchema }),
z.object({ status: z.literal(422), body: ErrorSchema })
]);
export const ContactsUpdateResponseSchema = z.discriminatedUnion('status', [
z.object({ status: z.literal(200), body: ContactsUpdateResponseBodySchema }),
z.object({ status: z.literal(422), body: ErrorSchema })
]);
export const ContactsDestroyResponseSchema = z.object({ status: z.literal(204) });
export interface Contact {
createdAt: string;
email: null | string;
id: string;
name: string;
notes: string;
phone: string;
updatedAt: string;
}
export interface ContactCreatePayload {
email: null | string;
name: string;
notes: string;
phone: string;
}
export interface ContactPage {
number?: number;
size?: number;
}
export interface ContactUpdatePayload {
email: null | string;
name?: string;
notes: string;
phone: string;
}
export interface ContactsCreateRequest {
body: ContactsCreateRequestBody;
}
export interface ContactsCreateRequestBody {
contact: ContactCreatePayload;
}
export type ContactsCreateResponse =
| { status: 200; body: ContactsCreateResponseBody }
| { status: 422; body: Error };
export type ContactsCreateResponseBody = { contact: Contact; meta?: Record<string, unknown> };
export type ContactsDestroyResponse = { status: 204 };
export interface ContactsIndexRequest {
query: ContactsIndexRequestQuery;
}
export interface ContactsIndexRequestQuery {
page?: ContactPage;
}
export type ContactsIndexResponse = { status: 200; body: ContactsIndexResponseBody };
export type ContactsIndexResponseBody = { contacts: Contact[]; meta?: Record<string, unknown>; pagination: OffsetPagination };
export type ContactsShowResponse = { status: 200; body: ContactsShowResponseBody };
export type ContactsShowResponseBody = { contact: Contact; meta?: Record<string, unknown> };
export interface ContactsUpdateRequest {
body: ContactsUpdateRequestBody;
}
export interface ContactsUpdateRequestBody {
contact: ContactUpdatePayload;
}
export type ContactsUpdateResponse =
| { status: 200; body: ContactsUpdateResponseBody }
| { status: 422; body: Error };
export type ContactsUpdateResponseBody = { contact: Contact; meta?: Record<string, unknown> };
export interface Error {
issues: ErrorIssue[];
layer: ErrorLayer;
}
export interface ErrorIssue {
code: string;
detail: string;
meta: Record<string, unknown>;
path: (number | string)[];
pointer: string;
}
export type ErrorLayer = 'contract' | 'domain' | 'http';
export interface OffsetPagination {
current: number;
items: number;
next: null | number;
prev: null | number;
total: number;
}OpenAPI
yml
---
openapi: 3.1.0
info:
title: "/swift_fox"
version: 1.0.0
paths:
"/contacts":
get:
operationId: contactsIndex
parameters:
- in: query
name: page
required: false
schema:
"$ref": "#/components/schemas/contactPage"
responses:
'200':
content:
application/json:
schema:
properties:
contacts:
items:
"$ref": "#/components/schemas/contact"
type: array
meta:
properties: {}
type: object
pagination:
"$ref": "#/components/schemas/offsetPagination"
type: object
required:
- contacts
- pagination
description: ''
post:
operationId: contactsCreate
requestBody:
content:
application/json:
schema:
properties:
contact:
"$ref": "#/components/schemas/contactCreatePayload"
type: object
required:
- contact
required: true
responses:
'200':
content:
application/json:
schema:
properties:
contact:
"$ref": "#/components/schemas/contact"
meta:
properties: {}
type: object
type: object
required:
- contact
description: ''
'422':
description: Unprocessable Entity
content:
application/json:
schema:
properties:
issues:
items:
"$ref": "#/components/schemas/error"
type: array
required:
- issues
type: object
"/contacts/{id}":
get:
operationId: contactsShow
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
properties:
contact:
"$ref": "#/components/schemas/contact"
meta:
properties: {}
type: object
type: object
required:
- contact
description: ''
patch:
operationId: contactsUpdate
parameters:
- in: path
name: id
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
properties:
contact:
"$ref": "#/components/schemas/contactUpdatePayload"
type: object
required:
- contact
required: true
responses:
'200':
content:
application/json:
schema:
properties:
contact:
"$ref": "#/components/schemas/contact"
meta:
properties: {}
type: object
type: object
required:
- contact
description: ''
'422':
description: Unprocessable Entity
content:
application/json:
schema:
properties:
issues:
items:
"$ref": "#/components/schemas/error"
type: array
required:
- issues
type: object
delete:
operationId: contactsDestroy
parameters:
- in: path
name: id
required: true
schema:
type: string
responses:
'204':
description: ''
components:
schemas:
contact:
properties:
createdAt:
type: string
format: date-time
email:
type:
- string
- 'null'
id:
type: string
name:
type: string
notes:
type: string
phone:
type: string
updatedAt:
type: string
format: date-time
type: object
required:
- createdAt
- email
- id
- name
- notes
- phone
- updatedAt
contactCreatePayload:
properties:
email:
type:
- string
- 'null'
default:
name:
type: string
notes:
type: string
default: ''
phone:
type: string
default: ''
type: object
required:
- name
contactPage:
properties:
number:
type: integer
minimum: 1
size:
type: integer
minimum: 1
maximum: 100
type: object
contactUpdatePayload:
properties:
email:
type:
- string
- 'null'
default:
name:
type: string
notes:
type: string
default: ''
phone:
type: string
default: ''
type: object
error:
properties:
issues:
items:
"$ref": "#/components/schemas/errorIssue"
type: array
layer:
enum:
- http
- contract
- domain
type: string
type: object
required:
- issues
- layer
errorIssue:
properties:
code:
type: string
detail:
type: string
meta:
properties: {}
type: object
path:
items:
oneOf:
- type: string
- type: integer
type: array
pointer:
type: string
type: object
required:
- code
- detail
- meta
- path
- pointer
offsetPagination:
properties:
current:
type: integer
items:
type: integer
next:
type:
- integer
- 'null'
default:
prev:
type:
- integer
- 'null'
default:
total:
type: integer
type: object
required:
- current
- items
- total