Refactor OpenAPI schemas and type definitions across versions 2.0, 3.0, and 3.1 for improved clarity and consistency. Update example files and tests to align with the latest specifications. Adjust package dependencies and enhance README documentation for better guidance on usage and testing.

This commit is contained in:
Luke Hagar
2025-09-30 20:36:16 +00:00
parent 4a82aa3b32
commit 3e81d0b30d
100 changed files with 141724 additions and 157789 deletions

View File

@@ -74,52 +74,52 @@ import type { Extension } from "./extensions";
* ```
*/
export interface XML extends Extension {
/**
* Replaces the name of the element/attribute used for the described schema property.
* When defined within the Items Object (items), it will affect the name of the individual
* XML elements within the list. When defined alongside type being array (outside the items),
* it will affect the wrapping element and only if wrapped is true. If wrapped is false,
* it will be ignored.
*
* @example "user"
* @example "id"
* @example "users"
*/
name?: string;
/**
* Replaces the name of the element/attribute used for the described schema property.
* When defined within the Items Object (items), it will affect the name of the individual
* XML elements within the list. When defined alongside type being array (outside the items),
* it will affect the wrapping element and only if wrapped is true. If wrapped is false,
* it will be ignored.
*
* @example "user"
* @example "id"
* @example "users"
*/
name?: string;
/**
* The URI of the namespace definition. This MUST be in the form of an absolute URI.
*
* @example "http://example.com/schema/user"
* @example "http://www.w3.org/XML/1998/namespace"
*/
namespace?: string;
/**
* The URI of the namespace definition. This MUST be in the form of an absolute URI.
*
* @example "http://example.com/schema/user"
* @example "http://www.w3.org/XML/1998/namespace"
*/
namespace?: string;
/**
* The prefix to be used for the name.
*
* @example "user"
* @example "xml"
*/
prefix?: string;
/**
* The prefix to be used for the name.
*
* @example "user"
* @example "xml"
*/
prefix?: string;
/**
* Declares whether the property definition translates to an attribute instead of an element.
* Default value is false.
*
* @example true
* @example false
*/
attribute?: boolean;
/**
* Declares whether the property definition translates to an attribute instead of an element.
* Default value is false.
*
* @example true
* @example false
*/
attribute?: boolean;
/**
* MAY be used only for an array definition. Signifies whether the array is wrapped
* (for example, `<books><book/><book/></books>`) or unwrapped
* (for example, `<book/><book/>`). Default value is false. The definition takes effect
* only when defined alongside type being array (outside the items).
*
* @example true
* @example false
*/
wrapped?: boolean;
/**
* MAY be used only for an array definition. Signifies whether the array is wrapped
* (for example, `<books><book/><book/></books>`) or unwrapped
* (for example, `<book/><book/>`). Default value is false. The definition takes effect
* only when defined alongside type being array (outside the items).
*
* @example true
* @example false
*/
wrapped?: boolean;
}