@kubb/oas 4.17.0 → 4.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-BdfDOGov.js +51 -0
- package/dist/index.cjs +320 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +317 -111
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/utils.ts +45 -0
package/dist/index.d.cts
CHANGED
|
@@ -8,6 +8,8 @@ import { DiscriminatorObject as DiscriminatorObject$1, HttpMethods as HttpMethod
|
|
|
8
8
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
9
9
|
import { Fabric } from "@kubb/react-fabric";
|
|
10
10
|
|
|
11
|
+
//#region rolldown:runtime
|
|
12
|
+
//#endregion
|
|
11
13
|
//#region src/types.d.ts
|
|
12
14
|
type contentType = 'application/json' | (string & {});
|
|
13
15
|
type SchemaObject = SchemaObject$1 & {
|
|
@@ -694,6 +696,17 @@ declare function isDiscriminator(obj?: any): obj is SchemaObject$1 & {
|
|
|
694
696
|
declare function isRequired(schema?: SchemaObject$1): boolean;
|
|
695
697
|
declare function isAllOptional(schema: unknown): boolean;
|
|
696
698
|
declare function isOptional(schema?: SchemaObject$1): boolean;
|
|
699
|
+
/**
|
|
700
|
+
* Determines the appropriate default value for a schema parameter.
|
|
701
|
+
* - For array types: returns '[]'
|
|
702
|
+
* - For union types (anyOf/oneOf):
|
|
703
|
+
* - If at least one variant has all-optional fields: returns '{}'
|
|
704
|
+
* - Otherwise: returns undefined (no default)
|
|
705
|
+
* - For object types with optional fields: returns '{}'
|
|
706
|
+
* - For primitive types (string, number, boolean): returns undefined (no default)
|
|
707
|
+
* - For required types: returns undefined (no default)
|
|
708
|
+
*/
|
|
709
|
+
declare function getDefaultValue(schema?: SchemaObject$1): string | undefined;
|
|
697
710
|
declare function parse(pathOrApi: string | Document, {
|
|
698
711
|
oasClass,
|
|
699
712
|
canBundle,
|
|
@@ -710,5 +723,5 @@ declare function merge(pathOrApi: Array<string | Document>, {
|
|
|
710
723
|
}): Promise<Oas>;
|
|
711
724
|
declare function parseFromConfig(config: Config, oasClass?: typeof Oas): Promise<Oas>;
|
|
712
725
|
//#endregion
|
|
713
|
-
export { DiscriminatorObject, Document, HttpMethod, HttpMethods, MediaTypeObject, Oas, type OasTypes, type OpenAPIV3, type OpenAPIV3_1, Operation, ReferenceObject, ResponseObject, SchemaObject, contentType, findSchemaDefinition, isAllOptional, isDiscriminator, isNullable, isOpenApiV3_1Document, isOptional, isParameterObject, isReference, isRequired, matchesMimeType, merge, parse, parseFromConfig };
|
|
726
|
+
export { DiscriminatorObject, Document, HttpMethod, HttpMethods, MediaTypeObject, Oas, type OasTypes, type OpenAPIV3, type OpenAPIV3_1, Operation, ReferenceObject, ResponseObject, SchemaObject, contentType, findSchemaDefinition, getDefaultValue, isAllOptional, isDiscriminator, isNullable, isOpenApiV3_1Document, isOptional, isParameterObject, isReference, isRequired, matchesMimeType, merge, parse, parseFromConfig };
|
|
714
727
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { i as __name } from "./chunk-BdfDOGov.js";
|
|
1
2
|
import { findSchemaDefinition, matchesMimeType } from "oas/utils";
|
|
2
3
|
import BaseOas from "oas";
|
|
3
4
|
import * as OasTypes from "oas/types";
|
|
@@ -694,6 +695,17 @@ declare function isDiscriminator(obj?: any): obj is SchemaObject$1 & {
|
|
|
694
695
|
declare function isRequired(schema?: SchemaObject$1): boolean;
|
|
695
696
|
declare function isAllOptional(schema: unknown): boolean;
|
|
696
697
|
declare function isOptional(schema?: SchemaObject$1): boolean;
|
|
698
|
+
/**
|
|
699
|
+
* Determines the appropriate default value for a schema parameter.
|
|
700
|
+
* - For array types: returns '[]'
|
|
701
|
+
* - For union types (anyOf/oneOf):
|
|
702
|
+
* - If at least one variant has all-optional fields: returns '{}'
|
|
703
|
+
* - Otherwise: returns undefined (no default)
|
|
704
|
+
* - For object types with optional fields: returns '{}'
|
|
705
|
+
* - For primitive types (string, number, boolean): returns undefined (no default)
|
|
706
|
+
* - For required types: returns undefined (no default)
|
|
707
|
+
*/
|
|
708
|
+
declare function getDefaultValue(schema?: SchemaObject$1): string | undefined;
|
|
697
709
|
declare function parse(pathOrApi: string | Document, {
|
|
698
710
|
oasClass,
|
|
699
711
|
canBundle,
|
|
@@ -710,5 +722,5 @@ declare function merge(pathOrApi: Array<string | Document>, {
|
|
|
710
722
|
}): Promise<Oas>;
|
|
711
723
|
declare function parseFromConfig(config: Config, oasClass?: typeof Oas): Promise<Oas>;
|
|
712
724
|
//#endregion
|
|
713
|
-
export { DiscriminatorObject, Document, HttpMethod, HttpMethods, MediaTypeObject, Oas, type OasTypes, type OpenAPIV3, type OpenAPIV3_1, Operation, ReferenceObject, ResponseObject, SchemaObject, contentType, findSchemaDefinition, isAllOptional, isDiscriminator, isNullable, isOpenApiV3_1Document, isOptional, isParameterObject, isReference, isRequired, matchesMimeType, merge, parse, parseFromConfig };
|
|
725
|
+
export { DiscriminatorObject, Document, HttpMethod, HttpMethods, MediaTypeObject, Oas, type OasTypes, type OpenAPIV3, type OpenAPIV3_1, Operation, ReferenceObject, ResponseObject, SchemaObject, contentType, findSchemaDefinition, getDefaultValue, isAllOptional, isDiscriminator, isNullable, isOpenApiV3_1Document, isOptional, isParameterObject, isReference, isRequired, matchesMimeType, merge, parse, parseFromConfig };
|
|
714
726
|
//# sourceMappingURL=index.d.ts.map
|