export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';

export interface JsonSchema {
  [key: string]: unknown;
  $ref?: string;
  type?: string | readonly string[];
  format?: string;
  description?: string;
  default?: unknown;
  enum?: readonly unknown[];
  oneOf?: readonly JsonSchema[];
  anyOf?: readonly JsonSchema[];
  items?: JsonSchema;
  properties?: Readonly<Record<string, JsonSchema>>;
  required?: readonly string[];
  minimum?: number;
  maximum?: number;
  minLength?: number;
  maxLength?: number;
  pattern?: string;
}

export interface OpenApiParameter {
  name: string;
  in: 'path' | 'query' | 'header';
  required?: boolean;
  description?: string;
  schema?: JsonSchema;
}

export interface PlatformOperation {
  id: string;
  method: HttpMethod;
  path: string;
  tag: string;
  summary: string;
  description: string;
  parameters: readonly OpenApiParameter[];
  requestSchema: JsonSchema | null;
  responseSchema: JsonSchema | null;
}

export type OperationInput = Record<string, unknown>;
