mirror of
https://github.com/LukeHagar/openapi-types.git
synced 2025-12-09 20:47:44 +00:00
Update bun.lock and package.json to include new dependencies and version updates. Enhance README with build process instructions and usage examples for schema generation. Refactor OpenAPI type definitions for improved clarity and modularity across versions 2.0, 3.0, and 3.1.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { Extension } from "../extensions";
|
||||
import type { XML } from "../xml";
|
||||
|
||||
/**
|
||||
* -----
|
||||
@@ -74,113 +75,121 @@ import type { Extension } from "../extensions";
|
||||
* ```
|
||||
*/
|
||||
export interface IntegerSchema extends Extension {
|
||||
/**
|
||||
* The type identifier for integer schemas.
|
||||
* Must be "integer".
|
||||
*/
|
||||
type: "integer";
|
||||
/**
|
||||
* The type identifier for integer schemas.
|
||||
* Must be "integer".
|
||||
*/
|
||||
type: "integer";
|
||||
|
||||
/**
|
||||
* The format of the integer.
|
||||
* See OpenAPI 3.1.x Data Type Formats for further details.
|
||||
*
|
||||
* Example: `"int32"`, `"int64"`
|
||||
*/
|
||||
format?: string;
|
||||
/**
|
||||
* The format of the integer.
|
||||
* See OpenAPI 3.1.x Data Type Formats for further details.
|
||||
*
|
||||
* Example: `"int32"`, `"int64"`
|
||||
*/
|
||||
format?: string;
|
||||
|
||||
/**
|
||||
* The integer must be a multiple of this value.
|
||||
* Must be a positive integer.
|
||||
*
|
||||
* Example: `5`
|
||||
*/
|
||||
multipleOf?: number;
|
||||
/**
|
||||
* The integer must be a multiple of this value.
|
||||
* Must be a positive integer.
|
||||
*
|
||||
* Example: `5`
|
||||
*/
|
||||
multipleOf?: number;
|
||||
|
||||
/**
|
||||
* The maximum value of the integer (inclusive).
|
||||
* The integer must be less than or equal to this value.
|
||||
*
|
||||
* Example: `100`
|
||||
*/
|
||||
maximum?: number;
|
||||
/**
|
||||
* The maximum value of the integer (inclusive).
|
||||
* The integer must be less than or equal to this value.
|
||||
*
|
||||
* Example: `100`
|
||||
*/
|
||||
maximum?: number;
|
||||
|
||||
/**
|
||||
* The minimum value of the integer (inclusive).
|
||||
* The integer must be greater than or equal to this value.
|
||||
*
|
||||
* Example: `0`
|
||||
*/
|
||||
minimum?: number;
|
||||
/**
|
||||
* The minimum value of the integer (inclusive).
|
||||
* The integer must be greater than or equal to this value.
|
||||
*
|
||||
* Example: `0`
|
||||
*/
|
||||
minimum?: number;
|
||||
|
||||
/**
|
||||
* The maximum value of the integer (exclusive).
|
||||
* The integer must be less than this value.
|
||||
*
|
||||
* Example: `100`
|
||||
*/
|
||||
exclusiveMaximum?: number;
|
||||
/**
|
||||
* The maximum value of the integer (exclusive).
|
||||
* The integer must be less than this value.
|
||||
*
|
||||
* Example: `100`
|
||||
*/
|
||||
exclusiveMaximum?: number;
|
||||
|
||||
/**
|
||||
* The minimum value of the integer (exclusive).
|
||||
* The integer must be greater than this value.
|
||||
*
|
||||
* Example: `0`
|
||||
*/
|
||||
exclusiveMinimum?: number;
|
||||
/**
|
||||
* The minimum value of the integer (exclusive).
|
||||
* The integer must be greater than this value.
|
||||
*
|
||||
* Example: `0`
|
||||
*/
|
||||
exclusiveMinimum?: number;
|
||||
|
||||
/**
|
||||
* An array of allowed values for the integer.
|
||||
* The value must be one of the values in this array.
|
||||
*
|
||||
* Example: `[1, 2, 3, 4, 5]`
|
||||
*/
|
||||
enum?: number[];
|
||||
/**
|
||||
* An array of allowed values for the integer.
|
||||
* The value must be one of the values in this array.
|
||||
*
|
||||
* Example: `[1, 2, 3, 4, 5]`
|
||||
*/
|
||||
enum?: number[];
|
||||
|
||||
/**
|
||||
* A single allowed value for the integer.
|
||||
* The value must be exactly this value.
|
||||
*
|
||||
* Example: `42`
|
||||
*/
|
||||
const?: number;
|
||||
/**
|
||||
* A single allowed value for the integer.
|
||||
* The value must be exactly this value.
|
||||
*
|
||||
* Example: `42`
|
||||
*/
|
||||
const?: number;
|
||||
|
||||
/**
|
||||
* An example value for the integer.
|
||||
* This is for documentation purposes only.
|
||||
*
|
||||
* Example: `42`
|
||||
*/
|
||||
example?: number;
|
||||
/**
|
||||
* An example value for the integer.
|
||||
* This is for documentation purposes only.
|
||||
*
|
||||
* Example: `42`
|
||||
*/
|
||||
example?: number;
|
||||
|
||||
/**
|
||||
* An array of example values for the integer.
|
||||
* These are for documentation purposes only.
|
||||
*
|
||||
* Example: `[1, 2, 3]`
|
||||
*/
|
||||
examples?: number[];
|
||||
/**
|
||||
* An array of example values for the integer.
|
||||
* These are for documentation purposes only.
|
||||
*
|
||||
* Example: `[1, 2, 3]`
|
||||
*/
|
||||
examples?: number[];
|
||||
|
||||
/**
|
||||
* The default value for the integer.
|
||||
* This value will be used if no value is provided.
|
||||
*
|
||||
* Example: `0`
|
||||
*/
|
||||
default?: number;
|
||||
/**
|
||||
* The default value for the integer.
|
||||
* This value will be used if no value is provided.
|
||||
*
|
||||
* Example: `0`
|
||||
*/
|
||||
default?: number;
|
||||
|
||||
/**
|
||||
* A short title for the schema.
|
||||
* This is for documentation purposes only.
|
||||
*
|
||||
* Example: `"User ID"`
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* A short title for the schema.
|
||||
* This is for documentation purposes only.
|
||||
*
|
||||
* Example: `"User ID"`
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* A description of the schema.
|
||||
* CommonMark syntax MAY be used for rich text representation.
|
||||
*
|
||||
* Example: `"The unique identifier of the user"`
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* A description of the schema.
|
||||
* CommonMark syntax MAY be used for rich text representation.
|
||||
*
|
||||
* Example: `"The unique identifier of the user"`
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* XML representation metadata for the schema.
|
||||
* Allows for fine-tuned XML model definitions.
|
||||
*
|
||||
* Example: `{ name: "userId", attribute: false }`
|
||||
*/
|
||||
xml?: XML;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user