diff --git a/.patches/openapi-extractor-mixed-object.diff b/.patches/openapi-extractor-mixed-object.diff new file mode 100644 index 0000000000..741a96d186 --- /dev/null +++ b/.patches/openapi-extractor-mixed-object.diff @@ -0,0 +1,136 @@ +--- a/src/OpenApiType.php ++++ b/src/OpenApiType.php +@@ -79,6 +79,87 @@ + + // https://github.com/OAI/OpenAPI-Specification/issues/1368#issuecomment-354037150 + return $type !== 'object' && $anyOf === null && ($allOf === null || (($nullable ?? false) && count($allOf) === 1)); ++ } ++ ++ /** ++ * OpenAPI 3.0 ignores keywords beside a Reference Object. Description and ++ * a default that conforms to the schema have to live on a Schema Object ++ * that wraps the reference. ++ * ++ * @param array> $schemas ++ */ ++ private function hasSchemaObjectKeywords(bool $isParameter, array $schemas): bool { ++ if ($this->type !== null || $this->format !== null || $this->nullable || $this->deprecated) { ++ return true; ++ } ++ if ($this->hasDefaultValue && !$this->hasUnknownDefaultValue && !$this->shouldOmitDefault($schemas)) { ++ return true; ++ } ++ if ($this->enum !== null || $this->items !== null || $this->additionalProperties !== null) { ++ return true; ++ } ++ if ($this->description !== null && $this->description !== '' && !$isParameter) { ++ return true; ++ } ++ if ($this->minLength !== null || $this->maxLength !== null || $this->minimum !== null || $this->maximum !== null || $this->minItems !== null || $this->maxItems !== null) { ++ return true; ++ } ++ if ($this->required !== null || ($this->properties !== null && $this->properties !== [])) { ++ return true; ++ } ++ if ($this->oneOf !== null || $this->anyOf !== null || $this->allOf !== null) { ++ return true; ++ } ++ ++ return false; ++ } ++ ++ /** ++ * An empty PHP array is the extractor's stand-in for an unspecified object. ++ * Beside a $ref it used to be ignored. Promoting it makes the default an ++ * array while the referenced schema is an object. ++ * ++ * @param array> $schemas ++ */ ++ private function shouldOmitDefault(array $schemas): bool { ++ if (!is_array($this->defaultValue) || count($this->defaultValue) !== 0) { ++ return false; ++ } ++ if ($this->type === 'object' || $this->type === 'array') { ++ return false; ++ } ++ ++ return $this->referencedSchemaIsObject($schemas); ++ } ++ ++ /** ++ * @param array> $schemas ++ */ ++ private function referencedSchemaIsObject(array $schemas): bool { ++ $refs = []; ++ if ($this->ref !== null) { ++ $refs[] = $this->ref; ++ } ++ foreach ($this->allOf ?? [] as $member) { ++ if ($member->type === 'object') { ++ return true; ++ } ++ if ($member->ref !== null) { ++ $refs[] = $member->ref; ++ } ++ } ++ foreach ($refs as $ref) { ++ $prefix = '#/components/schemas/'; ++ if (!str_starts_with($ref, $prefix)) { ++ continue; ++ } ++ $schema = $schemas[substr($ref, strlen($prefix))] ?? null; ++ if (is_array($schema) && ($schema['type'] ?? null) === 'object') { ++ return true; ++ } ++ } ++ ++ return false; + } + + /** +@@ -95,6 +176,18 @@ + ))->toArray($schemas, $isParameter); + } + ++ if ($this->ref !== null && $this->hasSchemaObjectKeywords($isParameter, $schemas)) { ++ $reference = new self( ++ context: $this->context, ++ ref: $this->ref, ++ ); ++ $schema = clone $this; ++ $schema->ref = null; ++ $schema->allOf = [...($schema->allOf ?? []), $reference]; ++ ++ return $schema->toArray($schemas, $isParameter); ++ } ++ + $values = []; + if ($this->ref !== null) { + $values['$ref'] = $this->ref; +@@ -111,7 +204,7 @@ + if ($this->deprecated) { + $values['deprecated'] = true; + } +- if ($this->hasDefaultValue && !$this->hasUnknownDefaultValue) { ++ if ($this->hasDefaultValue && !$this->hasUnknownDefaultValue && !$this->shouldOmitDefault($schemas)) { + $values['default'] = $this->type === 'object' && is_array($this->defaultValue) && count($this->defaultValue) === 0 ? new stdClass() : $this->defaultValue; + } + if ($this->enum !== null) { +@@ -243,6 +336,17 @@ + $key = $node->genericTypes[0] instanceof IdentifierTypeNode ? $node->genericTypes[0]->name : $node->genericTypes[0]->type->name; + $allowedTypes = ['string', 'lowercase-string', 'non-empty-string', 'non-empty-lowercase-string', 'class-string']; + if (in_array($key, $allowedTypes, true)) { ++ $valueType = $node->genericTypes[1]; ++ // array is an object whose values are unrestricted. ++ // A nested `{type: object}` schema would reject scalars, lists and null. ++ if ($valueType instanceof IdentifierTypeNode && $valueType->name === 'mixed') { ++ return new OpenApiType( ++ context: $context, ++ type: 'object', ++ additionalProperties: true, ++ ); ++ } ++ + return new OpenApiType( + context: $context, + type: 'object', diff --git a/openapi-administration.json b/openapi-administration.json index d4ce2ce7d4..445aa8f240 100644 --- a/openapi-administration.json +++ b/openapi-administration.json @@ -577,9 +577,7 @@ }, { "type": "object", - "additionalProperties": { - "type": "object" - } + "additionalProperties": true } ] }, @@ -3979,8 +3977,12 @@ ], "properties": { "value": { - "$ref": "#/components/schemas/EffectivePolicyValue", - "description": "Policy value to persist as an explicit system rule, even when it equals the default. Null removes the explicit system rule: the built-in default applies and lower layers may override it." + "description": "Policy value to persist as an explicit system rule, even when it equals the default. Null removes the explicit system rule: the built-in default applies and lower layers may override it.", + "allOf": [ + { + "$ref": "#/components/schemas/EffectivePolicyValue" + } + ] }, "allowChildOverride": { "type": "boolean", @@ -4170,9 +4172,12 @@ "type": "object", "properties": { "values": { - "$ref": "#/components/schemas/PolicyValueMap", - "default": [], - "description": "Values to persist, keyed by policy identifier, each as an explicit system rule even when it equals the default. Null removes the explicit system rule of that policy: the built-in default applies and lower layers may override it." + "description": "Values to persist, keyed by policy identifier, each as an explicit system rule even when it equals the default. Null removes the explicit system rule of that policy: the built-in default applies and lower layers may override it.", + "allOf": [ + { + "$ref": "#/components/schemas/PolicyValueMap" + } + ] }, "allowChildOverride": { "type": "object", diff --git a/openapi-full.json b/openapi-full.json index a1af7f85f0..98530610a8 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -1084,9 +1084,7 @@ }, { "type": "object", - "additionalProperties": { - "type": "object" - } + "additionalProperties": true } ] }, @@ -3640,9 +3638,7 @@ }, { "type": "object", - "additionalProperties": { - "type": "object" - } + "additionalProperties": true } ] }, @@ -5457,8 +5453,12 @@ ], "properties": { "value": { - "$ref": "#/components/schemas/UserConfigValue", - "description": "Config value as a JSON string, number, boolean, list or nested object. Null is not a storable setting." + "description": "Config value as a JSON string, number, boolean, list or nested object. Null is not a storable setting.", + "allOf": [ + { + "$ref": "#/components/schemas/UserConfigValue" + } + ] } } } @@ -6783,9 +6783,12 @@ "type": "object", "properties": { "file": { - "$ref": "#/components/schemas/NewFile", - "default": [], - "description": "File to save" + "description": "File to save", + "allOf": [ + { + "$ref": "#/components/schemas/NewFile" + } + ] }, "name": { "type": "string", @@ -6793,9 +6796,12 @@ "description": "The name of file to sign" }, "settings": { - "$ref": "#/components/schemas/FolderSettings", - "default": [], - "description": "Settings to define how and where the file should be stored" + "description": "Settings to define how and where the file should be stored", + "allOf": [ + { + "$ref": "#/components/schemas/FolderSettings" + } + ] }, "files": { "type": "array", @@ -7361,9 +7367,12 @@ "description": "Metadata of visible elements to associate with the document" }, "coordinates": { - "$ref": "#/components/schemas/Coordinate", - "default": [], - "description": "Coortinates of a visible element on PDF" + "description": "Coortinates of a visible element on PDF", + "allOf": [ + { + "$ref": "#/components/schemas/Coordinate" + } + ] } } } @@ -7544,9 +7553,12 @@ "description": "Metadata of visible elements to associate with the document" }, "coordinates": { - "$ref": "#/components/schemas/Coordinate", - "default": [], - "description": "Coortinates of a visible element on PDF" + "description": "Coortinates of a visible element on PDF", + "allOf": [ + { + "$ref": "#/components/schemas/Coordinate" + } + ] } } } @@ -10223,8 +10235,12 @@ ], "properties": { "value": { - "$ref": "#/components/schemas/EffectivePolicyValue", - "description": "Policy value to persist for the group." + "description": "Policy value to persist for the group.", + "allOf": [ + { + "$ref": "#/components/schemas/EffectivePolicyValue" + } + ] }, "allowChildOverride": { "type": "boolean", @@ -10878,8 +10894,12 @@ ], "properties": { "value": { - "$ref": "#/components/schemas/EffectivePolicyValue", - "description": "Policy value to persist as assigned target user policy." + "description": "Policy value to persist as assigned target user policy.", + "allOf": [ + { + "$ref": "#/components/schemas/EffectivePolicyValue" + } + ] }, "allowChildOverride": { "type": "boolean", @@ -11381,9 +11401,12 @@ "type": "object", "properties": { "values": { - "$ref": "#/components/schemas/PolicyValueMap", - "default": [], - "description": "Values to persist for the group, keyed by policy identifier." + "description": "Values to persist for the group, keyed by policy identifier.", + "allOf": [ + { + "$ref": "#/components/schemas/PolicyValueMap" + } + ] }, "allowChildOverride": { "type": "object", @@ -11587,9 +11610,12 @@ "type": "object", "properties": { "values": { - "$ref": "#/components/schemas/PolicyValueMap", - "default": [], - "description": "Values to persist as the current user's defaults, keyed by policy identifier." + "description": "Values to persist as the current user's defaults, keyed by policy identifier.", + "allOf": [ + { + "$ref": "#/components/schemas/PolicyValueMap" + } + ] } } } @@ -11745,9 +11771,12 @@ "type": "object", "properties": { "values": { - "$ref": "#/components/schemas/PolicyValueMap", - "default": [], - "description": "Values to persist for the target user, keyed by policy identifier." + "description": "Values to persist for the target user, keyed by policy identifier.", + "allOf": [ + { + "$ref": "#/components/schemas/PolicyValueMap" + } + ] }, "allowChildOverride": { "type": "object", @@ -11954,8 +11983,12 @@ ], "properties": { "value": { - "$ref": "#/components/schemas/EffectivePolicyValue", - "description": "Policy value to persist as the current user's default." + "description": "Policy value to persist as the current user's default.", + "allOf": [ + { + "$ref": "#/components/schemas/EffectivePolicyValue" + } + ] } } } @@ -12264,14 +12297,20 @@ "description": "The name of file to sign" }, "settings": { - "$ref": "#/components/schemas/FolderSettings", - "default": [], - "description": "Settings to define how and where the file should be stored" + "description": "Settings to define how and where the file should be stored", + "allOf": [ + { + "$ref": "#/components/schemas/FolderSettings" + } + ] }, "file": { - "$ref": "#/components/schemas/NewFile", - "default": [], - "description": "File object. Supports nodeId (a non-negative integer or its canonical decimal string, as Nextcloud node ids can exceed a JavaScript number), url, base64 or path." + "description": "File object. Supports nodeId (a non-negative integer or its canonical decimal string, as Nextcloud node ids can exceed a JavaScript number), url, base64 or path.", + "allOf": [ + { + "$ref": "#/components/schemas/NewFile" + } + ] }, "files": { "type": "array", @@ -12511,9 +12550,12 @@ "description": "The name of file to sign" }, "settings": { - "$ref": "#/components/schemas/FolderSettings", - "default": [], - "description": "Settings to define how and where the file should be stored" + "description": "Settings to define how and where the file should be stored", + "allOf": [ + { + "$ref": "#/components/schemas/FolderSettings" + } + ] }, "files": { "type": "array", @@ -14658,9 +14700,12 @@ "description": "The type of signature element" }, "file": { - "$ref": "#/components/schemas/SavedSignatureFile", - "default": [], - "description": "Signature image supplied as base64 or URL" + "description": "Signature image supplied as base64 or URL", + "allOf": [ + { + "$ref": "#/components/schemas/SavedSignatureFile" + } + ] } } } @@ -17928,8 +17973,12 @@ ], "properties": { "value": { - "$ref": "#/components/schemas/EffectivePolicyValue", - "description": "Policy value to persist as an explicit system rule, even when it equals the default. Null removes the explicit system rule: the built-in default applies and lower layers may override it." + "description": "Policy value to persist as an explicit system rule, even when it equals the default. Null removes the explicit system rule: the built-in default applies and lower layers may override it.", + "allOf": [ + { + "$ref": "#/components/schemas/EffectivePolicyValue" + } + ] }, "allowChildOverride": { "type": "boolean", @@ -18119,9 +18168,12 @@ "type": "object", "properties": { "values": { - "$ref": "#/components/schemas/PolicyValueMap", - "default": [], - "description": "Values to persist, keyed by policy identifier, each as an explicit system rule even when it equals the default. Null removes the explicit system rule of that policy: the built-in default applies and lower layers may override it." + "description": "Values to persist, keyed by policy identifier, each as an explicit system rule even when it equals the default. Null removes the explicit system rule of that policy: the built-in default applies and lower layers may override it.", + "allOf": [ + { + "$ref": "#/components/schemas/PolicyValueMap" + } + ] }, "allowChildOverride": { "type": "object", diff --git a/openapi.json b/openapi.json index f52dbe1baa..fb144d7e2c 100644 --- a/openapi.json +++ b/openapi.json @@ -811,9 +811,7 @@ }, { "type": "object", - "additionalProperties": { - "type": "object" - } + "additionalProperties": true } ] }, @@ -3098,9 +3096,7 @@ }, { "type": "object", - "additionalProperties": { - "type": "object" - } + "additionalProperties": true } ] }, @@ -4915,8 +4911,12 @@ ], "properties": { "value": { - "$ref": "#/components/schemas/UserConfigValue", - "description": "Config value as a JSON string, number, boolean, list or nested object. Null is not a storable setting." + "description": "Config value as a JSON string, number, boolean, list or nested object. Null is not a storable setting.", + "allOf": [ + { + "$ref": "#/components/schemas/UserConfigValue" + } + ] } } } @@ -6241,9 +6241,12 @@ "type": "object", "properties": { "file": { - "$ref": "#/components/schemas/NewFile", - "default": [], - "description": "File to save" + "description": "File to save", + "allOf": [ + { + "$ref": "#/components/schemas/NewFile" + } + ] }, "name": { "type": "string", @@ -6251,9 +6254,12 @@ "description": "The name of file to sign" }, "settings": { - "$ref": "#/components/schemas/FolderSettings", - "default": [], - "description": "Settings to define how and where the file should be stored" + "description": "Settings to define how and where the file should be stored", + "allOf": [ + { + "$ref": "#/components/schemas/FolderSettings" + } + ] }, "files": { "type": "array", @@ -6819,9 +6825,12 @@ "description": "Metadata of visible elements to associate with the document" }, "coordinates": { - "$ref": "#/components/schemas/Coordinate", - "default": [], - "description": "Coortinates of a visible element on PDF" + "description": "Coortinates of a visible element on PDF", + "allOf": [ + { + "$ref": "#/components/schemas/Coordinate" + } + ] } } } @@ -7002,9 +7011,12 @@ "description": "Metadata of visible elements to associate with the document" }, "coordinates": { - "$ref": "#/components/schemas/Coordinate", - "default": [], - "description": "Coortinates of a visible element on PDF" + "description": "Coortinates of a visible element on PDF", + "allOf": [ + { + "$ref": "#/components/schemas/Coordinate" + } + ] } } } @@ -9486,8 +9498,12 @@ ], "properties": { "value": { - "$ref": "#/components/schemas/EffectivePolicyValue", - "description": "Policy value to persist for the group." + "description": "Policy value to persist for the group.", + "allOf": [ + { + "$ref": "#/components/schemas/EffectivePolicyValue" + } + ] }, "allowChildOverride": { "type": "boolean", @@ -10141,8 +10157,12 @@ ], "properties": { "value": { - "$ref": "#/components/schemas/EffectivePolicyValue", - "description": "Policy value to persist as assigned target user policy." + "description": "Policy value to persist as assigned target user policy.", + "allOf": [ + { + "$ref": "#/components/schemas/EffectivePolicyValue" + } + ] }, "allowChildOverride": { "type": "boolean", @@ -10644,9 +10664,12 @@ "type": "object", "properties": { "values": { - "$ref": "#/components/schemas/PolicyValueMap", - "default": [], - "description": "Values to persist for the group, keyed by policy identifier." + "description": "Values to persist for the group, keyed by policy identifier.", + "allOf": [ + { + "$ref": "#/components/schemas/PolicyValueMap" + } + ] }, "allowChildOverride": { "type": "object", @@ -10850,9 +10873,12 @@ "type": "object", "properties": { "values": { - "$ref": "#/components/schemas/PolicyValueMap", - "default": [], - "description": "Values to persist as the current user's defaults, keyed by policy identifier." + "description": "Values to persist as the current user's defaults, keyed by policy identifier.", + "allOf": [ + { + "$ref": "#/components/schemas/PolicyValueMap" + } + ] } } } @@ -11008,9 +11034,12 @@ "type": "object", "properties": { "values": { - "$ref": "#/components/schemas/PolicyValueMap", - "default": [], - "description": "Values to persist for the target user, keyed by policy identifier." + "description": "Values to persist for the target user, keyed by policy identifier.", + "allOf": [ + { + "$ref": "#/components/schemas/PolicyValueMap" + } + ] }, "allowChildOverride": { "type": "object", @@ -11217,8 +11246,12 @@ ], "properties": { "value": { - "$ref": "#/components/schemas/EffectivePolicyValue", - "description": "Policy value to persist as the current user's default." + "description": "Policy value to persist as the current user's default.", + "allOf": [ + { + "$ref": "#/components/schemas/EffectivePolicyValue" + } + ] } } } @@ -11527,14 +11560,20 @@ "description": "The name of file to sign" }, "settings": { - "$ref": "#/components/schemas/FolderSettings", - "default": [], - "description": "Settings to define how and where the file should be stored" + "description": "Settings to define how and where the file should be stored", + "allOf": [ + { + "$ref": "#/components/schemas/FolderSettings" + } + ] }, "file": { - "$ref": "#/components/schemas/NewFile", - "default": [], - "description": "File object. Supports nodeId (a non-negative integer or its canonical decimal string, as Nextcloud node ids can exceed a JavaScript number), url, base64 or path." + "description": "File object. Supports nodeId (a non-negative integer or its canonical decimal string, as Nextcloud node ids can exceed a JavaScript number), url, base64 or path.", + "allOf": [ + { + "$ref": "#/components/schemas/NewFile" + } + ] }, "files": { "type": "array", @@ -11774,9 +11813,12 @@ "description": "The name of file to sign" }, "settings": { - "$ref": "#/components/schemas/FolderSettings", - "default": [], - "description": "Settings to define how and where the file should be stored" + "description": "Settings to define how and where the file should be stored", + "allOf": [ + { + "$ref": "#/components/schemas/FolderSettings" + } + ] }, "files": { "type": "array", @@ -13921,9 +13963,12 @@ "description": "The type of signature element" }, "file": { - "$ref": "#/components/schemas/SavedSignatureFile", - "default": [], - "description": "Signature image supplied as base64 or URL" + "description": "Signature image supplied as base64 or URL", + "allOf": [ + { + "$ref": "#/components/schemas/SavedSignatureFile" + } + ] } } } diff --git a/src/types/openapi/openapi-administration.ts b/src/types/openapi/openapi-administration.ts index 6a280db00c..f37c89a080 100644 --- a/src/types/openapi/openapi-administration.ts +++ b/src/types/openapi/openapi-administration.ts @@ -500,7 +500,7 @@ export type components = { everyoneCount: number; }; EffectivePolicyValue: (boolean | number | string | { - [key: string]: Record; + [key: string]: unknown; }) | null; EngineHandler: { configPath: string; @@ -2015,10 +2015,7 @@ export interface operations { requestBody?: { content: { "application/json": { - /** - * @description Values to persist, keyed by policy identifier, each as an explicit system rule even when it equals the default. Null removes the explicit system rule of that policy: the built-in default applies and lower layers may override it. - * @default [] - */ + /** @description Values to persist, keyed by policy identifier, each as an explicit system rule even when it equals the default. Null removes the explicit system rule of that policy: the built-in default applies and lower layers may override it. */ values?: components["schemas"]["PolicyValueMap"]; /** * @description Whether lower layers may override each saved value, keyed by policy identifier. diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index c2cde313ad..77135b9270 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -1647,7 +1647,7 @@ export type components = { everyoneCount: number; }; EffectivePolicyValue: (boolean | number | string | { - [key: string]: Record; + [key: string]: unknown; }) | null; EngineHandler: { configPath: string; @@ -2351,7 +2351,7 @@ export type components = { }; }; UserConfigValue: string | boolean | number | Record[] | { - [key: string]: Record; + [key: string]: unknown; }; UserElement: { /** Format: int64 */ @@ -3608,20 +3608,14 @@ export interface operations { requestBody?: { content: { "application/json": { - /** - * @description File to save - * @default [] - */ + /** @description File to save */ file?: components["schemas"]["NewFile"]; /** * @description The name of file to sign * @default */ name?: string; - /** - * @description Settings to define how and where the file should be stored - * @default [] - */ + /** @description Settings to define how and where the file should be stored */ settings?: components["schemas"]["FolderSettings"]; /** * @description Multiple files to create an envelope (optional, use either file or files) @@ -3876,10 +3870,7 @@ export interface operations { * @default {} */ metadata?: Record; - /** - * @description Coortinates of a visible element on PDF - * @default [] - */ + /** @description Coortinates of a visible element on PDF */ coordinates?: components["schemas"]["Coordinate"]; }; }; @@ -4031,10 +4022,7 @@ export interface operations { * @default {} */ metadata?: Record; - /** - * @description Coortinates of a visible element on PDF - * @default [] - */ + /** @description Coortinates of a visible element on PDF */ coordinates?: components["schemas"]["Coordinate"]; }; }; @@ -5583,10 +5571,7 @@ export interface operations { requestBody?: { content: { "application/json": { - /** - * @description Values to persist for the group, keyed by policy identifier. - * @default [] - */ + /** @description Values to persist for the group, keyed by policy identifier. */ values?: components["schemas"]["PolicyValueMap"]; /** * @description Whether users and requests below this group may override each saved value, keyed by policy identifier. @@ -5674,10 +5659,7 @@ export interface operations { requestBody?: { content: { "application/json": { - /** - * @description Values to persist as the current user's defaults, keyed by policy identifier. - * @default [] - */ + /** @description Values to persist as the current user's defaults, keyed by policy identifier. */ values?: components["schemas"]["PolicyValueMap"]; }; }; @@ -5746,10 +5728,7 @@ export interface operations { requestBody?: { content: { "application/json": { - /** - * @description Values to persist for the target user, keyed by policy identifier. - * @default [] - */ + /** @description Values to persist for the target user, keyed by policy identifier. */ values?: components["schemas"]["PolicyValueMap"]; /** * @description Whether the target user may still override each assigned value, keyed by policy identifier. @@ -5972,15 +5951,9 @@ export interface operations { * @default */ name?: string; - /** - * @description Settings to define how and where the file should be stored - * @default [] - */ + /** @description Settings to define how and where the file should be stored */ settings?: components["schemas"]["FolderSettings"]; - /** - * @description File object. Supports nodeId (a non-negative integer or its canonical decimal string, as Nextcloud node ids can exceed a JavaScript number), url, base64 or path. - * @default [] - */ + /** @description File object. Supports nodeId (a non-negative integer or its canonical decimal string, as Nextcloud node ids can exceed a JavaScript number), url, base64 or path. */ file?: components["schemas"]["NewFile"]; /** * @description Multiple files to create an envelope (optional, use either file or files). Each file supports nodeId, url, base64 or path. @@ -6102,10 +6075,7 @@ export interface operations { * @default null */ name?: string | null; - /** - * @description Settings to define how and where the file should be stored - * @default [] - */ + /** @description Settings to define how and where the file should be stored */ settings?: components["schemas"]["FolderSettings"]; /** * @description Multiple files to create an envelope (optional, use either file or files). Each file supports nodeId, url, base64 or path. @@ -7081,10 +7051,7 @@ export interface operations { * @default */ type?: string; - /** - * @description Signature image supplied as base64 or URL - * @default [] - */ + /** @description Signature image supplied as base64 or URL */ file?: components["schemas"]["SavedSignatureFile"]; }; }; @@ -8549,10 +8516,7 @@ export interface operations { requestBody?: { content: { "application/json": { - /** - * @description Values to persist, keyed by policy identifier, each as an explicit system rule even when it equals the default. Null removes the explicit system rule of that policy: the built-in default applies and lower layers may override it. - * @default [] - */ + /** @description Values to persist, keyed by policy identifier, each as an explicit system rule even when it equals the default. Null removes the explicit system rule of that policy: the built-in default applies and lower layers may override it. */ values?: components["schemas"]["PolicyValueMap"]; /** * @description Whether lower layers may override each saved value, keyed by policy identifier. diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 095259b876..782877d519 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -1247,7 +1247,7 @@ export type components = { everyoneCount: number; }; EffectivePolicyValue: (boolean | number | string | { - [key: string]: Record; + [key: string]: unknown; }) | null; ErrorItem: { message: string; @@ -1883,7 +1883,7 @@ export type components = { }; }; UserConfigValue: string | boolean | number | Record[] | { - [key: string]: Record; + [key: string]: unknown; }; UserElement: { /** Format: int64 */ @@ -3140,20 +3140,14 @@ export interface operations { requestBody?: { content: { "application/json": { - /** - * @description File to save - * @default [] - */ + /** @description File to save */ file?: components["schemas"]["NewFile"]; /** * @description The name of file to sign * @default */ name?: string; - /** - * @description Settings to define how and where the file should be stored - * @default [] - */ + /** @description Settings to define how and where the file should be stored */ settings?: components["schemas"]["FolderSettings"]; /** * @description Multiple files to create an envelope (optional, use either file or files) @@ -3408,10 +3402,7 @@ export interface operations { * @default {} */ metadata?: Record; - /** - * @description Coortinates of a visible element on PDF - * @default [] - */ + /** @description Coortinates of a visible element on PDF */ coordinates?: components["schemas"]["Coordinate"]; }; }; @@ -3563,10 +3554,7 @@ export interface operations { * @default {} */ metadata?: Record; - /** - * @description Coortinates of a visible element on PDF - * @default [] - */ + /** @description Coortinates of a visible element on PDF */ coordinates?: components["schemas"]["Coordinate"]; }; }; @@ -5021,10 +5009,7 @@ export interface operations { requestBody?: { content: { "application/json": { - /** - * @description Values to persist for the group, keyed by policy identifier. - * @default [] - */ + /** @description Values to persist for the group, keyed by policy identifier. */ values?: components["schemas"]["PolicyValueMap"]; /** * @description Whether users and requests below this group may override each saved value, keyed by policy identifier. @@ -5112,10 +5097,7 @@ export interface operations { requestBody?: { content: { "application/json": { - /** - * @description Values to persist as the current user's defaults, keyed by policy identifier. - * @default [] - */ + /** @description Values to persist as the current user's defaults, keyed by policy identifier. */ values?: components["schemas"]["PolicyValueMap"]; }; }; @@ -5184,10 +5166,7 @@ export interface operations { requestBody?: { content: { "application/json": { - /** - * @description Values to persist for the target user, keyed by policy identifier. - * @default [] - */ + /** @description Values to persist for the target user, keyed by policy identifier. */ values?: components["schemas"]["PolicyValueMap"]; /** * @description Whether the target user may still override each assigned value, keyed by policy identifier. @@ -5410,15 +5389,9 @@ export interface operations { * @default */ name?: string; - /** - * @description Settings to define how and where the file should be stored - * @default [] - */ + /** @description Settings to define how and where the file should be stored */ settings?: components["schemas"]["FolderSettings"]; - /** - * @description File object. Supports nodeId (a non-negative integer or its canonical decimal string, as Nextcloud node ids can exceed a JavaScript number), url, base64 or path. - * @default [] - */ + /** @description File object. Supports nodeId (a non-negative integer or its canonical decimal string, as Nextcloud node ids can exceed a JavaScript number), url, base64 or path. */ file?: components["schemas"]["NewFile"]; /** * @description Multiple files to create an envelope (optional, use either file or files). Each file supports nodeId, url, base64 or path. @@ -5540,10 +5513,7 @@ export interface operations { * @default null */ name?: string | null; - /** - * @description Settings to define how and where the file should be stored - * @default [] - */ + /** @description Settings to define how and where the file should be stored */ settings?: components["schemas"]["FolderSettings"]; /** * @description Multiple files to create an envelope (optional, use either file or files). Each file supports nodeId, url, base64 or path. @@ -6519,10 +6489,7 @@ export interface operations { * @default */ type?: string; - /** - * @description Signature image supplied as base64 or URL - * @default [] - */ + /** @description Signature image supplied as base64 or URL */ file?: components["schemas"]["SavedSignatureFile"]; }; }; diff --git a/tests/php/openapi/OpenApiExtractorSchemaTest.php b/tests/php/openapi/OpenApiExtractorSchemaTest.php new file mode 100644 index 0000000000..96514ce8df --- /dev/null +++ b/tests/php/openapi/OpenApiExtractorSchemaTest.php @@ -0,0 +1,173 @@ +', [], new GenericTypeNode( + new IdentifierTypeNode('array'), + [ + new IdentifierTypeNode('string'), + new IdentifierTypeNode('mixed'), + ], + )); + + $schema = $this->schema($type); + $this->assertSame('object', $schema['type']); + $this->assertTrue($schema['additionalProperties']); + } + + public function testNestedMixedMapKeepsOnlyItsInnerValuesUnrestricted(): void { + $type = OpenApiType::resolve('nested map', [], new GenericTypeNode( + new IdentifierTypeNode('array'), + [ + new IdentifierTypeNode('string'), + new GenericTypeNode(new IdentifierTypeNode('array'), [ + new IdentifierTypeNode('string'), + new IdentifierTypeNode('mixed'), + ]), + ], + )); + + $this->assertSame([ + 'type' => 'object', + 'additionalProperties' => ['type' => 'object', 'additionalProperties' => true], + ], $this->schema($type)); + } + + public function testTypedMapDoesNotBecomeUnrestricted(): void { + $type = OpenApiType::resolve('string map', [], new GenericTypeNode( + new IdentifierTypeNode('array'), + [new IdentifierTypeNode('string'), new IdentifierTypeNode('string')], + )); + + $this->assertSame([ + 'type' => 'object', + 'additionalProperties' => ['type' => 'string'], + ], $this->schema($type)); + } + + public function testBareReferenceStaysBare(): void { + $type = new OpenApiType(context: 'bare reference', ref: '#/components/schemas/NewFile'); + + $this->assertSame(['$ref' => '#/components/schemas/NewFile'], $this->schema($type)); + } + + public function testArrayAndInlineObjectDefaultsKeepTheirJsonTypes(): void { + $schemas = ['Items' => ['type' => 'array', 'items' => ['type' => 'string']]]; + $reference = new OpenApiType( + context: 'array reference', ref: '#/components/schemas/Items', + hasDefaultValue: true, defaultValue: [], description: 'Items to save', + ); + $this->assertSame([], $this->schema($reference, $schemas)['default']); + $this->assertSame([['$ref' => '#/components/schemas/Items']], $this->schema($reference, $schemas)['allOf']); + + $object = new OpenApiType(context: 'inline object', type: 'object', hasDefaultValue: true, defaultValue: []); + $this->assertInstanceOf(\stdClass::class, $object->toArray([])['default']); + } + + public function testAliasTypedRequestParameterKeepsDescriptionAndDefaultOutsideRef(): void { + $type = OpenApiType::resolve('value', [ + 'LibresignEffectivePolicyValue' => new IdentifierTypeNode('string'), + ], new IdentifierTypeNode('LibresignEffectivePolicyValue')); + $type->description = 'Policy value to persist for the group.'; + $type->hasDefaultValue = true; + $type->defaultValue = null; + + $schema = $this->schema($type, ['EffectivePolicyValue' => ['type' => 'string', 'nullable' => true]]); + $this->assertArrayNotHasKey('$ref', $schema); + $this->assertSame(['$ref'], array_keys($schema['allOf'][0])); + $this->assertSame('#/components/schemas/EffectivePolicyValue', $schema['allOf'][0]['$ref']); + $this->assertSame('Policy value to persist for the group.', $schema['description']); + $this->assertNull($schema['default']); + } + + public function testObjectRefDoesNotPromoteAnEmptyArrayDefault(): void { + $type = OpenApiType::resolve('file', [ + 'LibresignNewFile' => new IdentifierTypeNode('string'), + ], new IdentifierTypeNode('LibresignNewFile')); + $type->description = 'File to save'; + $type->hasDefaultValue = true; + $type->defaultValue = []; + + $schema = $this->schema($type, [ + 'NewFile' => ['type' => 'object'], + ]); + $this->assertArrayNotHasKey('$ref', $schema); + $this->assertArrayNotHasKey('default', $schema); + $this->assertSame('File to save', $schema['description']); + $this->assertSame(['$ref'], array_keys($schema['allOf'][0])); + $this->assertSame('#/components/schemas/NewFile', $schema['allOf'][0]['$ref']); + } + + public function testGeneratedObjectRefsDoNotDeclareArrayDefaults(): void { + $spec = json_decode(file_get_contents(dirname(__DIR__, 3) . '/openapi-full.json'), true, 512, JSON_THROW_ON_ERROR); + $expected = [ + 'file-save' => ['file' => 'NewFile', 'settings' => 'FolderSettings'], + 'file_element-create-visible-element' => ['coordinates' => 'Coordinate'], + 'file_element-update-visible-element' => ['coordinates' => 'Coordinate'], + 'request_signature-request-signature' => ['file' => 'NewFile', 'settings' => 'FolderSettings'], + 'request_signature-update-signature-request' => ['settings' => 'FolderSettings'], + ]; + $found = []; + foreach ($spec['paths'] as $path) { + foreach ($path as $operation) { + $id = $operation['operationId'] ?? ''; + if (!isset($expected[$id])) { + continue; + } + $properties = $operation['requestBody']['content']['application/json']['schema']['properties']; + foreach ($expected[$id] as $name => $schemaName) { + $property = $properties[$name]; + $this->assertArrayNotHasKey('default', $property, $id . '.' . $name); + $this->assertSame('#/components/schemas/' . $schemaName, $property['allOf'][0]['$ref'], $id . '.' . $name); + $this->assertSame('object', $spec['components']['schemas'][$schemaName]['type'], $schemaName); + $this->assertNotSame('', $property['description'], $id . '.' . $name); + } + $found[] = $id; + } + } + $this->assertSame(array_keys($expected), $found); + } + + public function testGeneratedReferencesHaveNoIgnoredSchemaKeywords(): void { + $visit = function (array $node) use (&$visit): void { + if (isset($node['$ref'])) { + $this->assertSame(['$ref'], array_keys($node), $node['$ref']); + } + foreach ($node as $child) { + if (is_array($child)) { + $visit($child); + } + } + }; + foreach (['openapi.json', 'openapi-administration.json', 'openapi-full.json'] as $file) { + $spec = json_decode(file_get_contents(dirname(__DIR__, 3) . '/' . $file), true, 512, JSON_THROW_ON_ERROR); + $visit($spec); + } + } + + private function schema(OpenApiType $type, array $schemas = []): array { + $decoded = json_decode(json_encode($type->toArray($schemas), JSON_THROW_ON_ERROR), true, 512, JSON_THROW_ON_ERROR); + $this->assertIsArray($decoded); + + return $decoded; + } +} diff --git a/tests/php/openapi/OpenApiPolicyValueTest.php b/tests/php/openapi/OpenApiPolicyValueTest.php new file mode 100644 index 0000000000..b75860527d --- /dev/null +++ b/tests/php/openapi/OpenApiPolicyValueTest.php @@ -0,0 +1,61 @@ +assertTrue($value['nullable'], $file); + $objects = array_values(array_filter($value['oneOf'], static fn (array $schema): bool => $schema['type'] === 'object')); + $this->assertCount(1, $objects, $file); + // Nested booleans, strings, lists and null must not be restricted to objects. + $this->assertTrue($objects[0]['additionalProperties'], $file); + } + } + + public function testIndividualAndCompoundWritesShareTheResponseValueContract(): void { + $spec = json_decode(file_get_contents(dirname(__DIR__, 3) . '/openapi-full.json'), true, 512, JSON_THROW_ON_ERROR); + $checked = []; + foreach ($spec['paths'] as $path) { + foreach ($path as $operation) { + $id = $operation['operationId'] ?? ''; + if (!str_starts_with($id, 'policy-set-')) { + continue; + } + $schema = $operation['requestBody']['content']['application/json']['schema']; + $properties = $schema['properties']; + if (isset($properties['value'])) { + $value = $properties['value']; + $this->assertContains('value', $schema['required'] ?? [], $id); + $this->assertArrayNotHasKey('$ref', $value, $id); + $this->assertArrayNotHasKey('default', $value, $id); + $this->assertSame(['$ref'], array_keys($value['allOf'][0]), $id); + $this->assertSame('#/components/schemas/EffectivePolicyValue', $value['allOf'][0]['$ref'], $id); + $this->assertNotSame('', $value['description'], $id); + } else { + $values = $properties['values']; + $this->assertArrayNotHasKey('$ref', $values, $id); + $this->assertArrayNotHasKey('default', $values, $id); + $this->assertSame([['$ref' => '#/components/schemas/PolicyValueMap']], $values['allOf'], $id); + $this->assertNotSame('', $values['description'], $id); + $map = $spec['components']['schemas']['PolicyValueMap']; + $this->assertSame('object', $map['type'], $id); + $this->assertSame(['$ref' => '#/components/schemas/EffectivePolicyValue'], $map['additionalProperties'], $id); + } + $checked[] = $id; + } + } + $this->assertCount(8, $checked); + } +} diff --git a/tests/php/openapi/OpenApiSigningRequestContractsTest.php b/tests/php/openapi/OpenApiSigningRequestContractsTest.php index 9eba4603de..903324627b 100644 --- a/tests/php/openapi/OpenApiSigningRequestContractsTest.php +++ b/tests/php/openapi/OpenApiSigningRequestContractsTest.php @@ -93,7 +93,8 @@ public function testSavedSignatureCreationAcceptsTypedList(): void { public function testSavedSignatureUpdateUsesTypedFile(): void { $spec = self::loadSpec('openapi-full.json'); $file = self::requestProperty($spec, 'signature_elements-patch-signature-element', 'file'); - self::assertSame('#/components/schemas/SavedSignatureFile', $file['$ref']); + self::assertSame([['$ref' => '#/components/schemas/SavedSignatureFile']], $file['allOf']); + self::assertArrayNotHasKey('default', $file); $definition = $spec['components']['schemas']['SavedSignatureFile']; foreach (['base64', 'url'] as $field) { self::assertSame('string', $definition['properties'][$field]['type']); @@ -180,7 +181,7 @@ public function testAccountConfigValueUsesARequiredHeterogeneousJsonContract(): self::assertTrue($operation['requestBody']['required']); $schema = $operation['requestBody']['content']['application/json']['schema']; self::assertSame(['value'], $schema['required']); - self::assertSame('#/components/schemas/UserConfigValue', $schema['properties']['value']['$ref']); + self::assertSame([['$ref' => '#/components/schemas/UserConfigValue']], $schema['properties']['value']['allOf']); $configValue = $spec['components']['schemas']['UserConfigValue']; $branches = $configValue['anyOf'] ?? $configValue['oneOf'] ?? []; @@ -206,7 +207,8 @@ public static function compoundPolicyOperations(): array { public function testCompoundPoliciesReferenceSharedValueMap(string $operationId): void { $spec = self::loadSpec('openapi-full.json'); $values = self::requestProperty($spec, $operationId, 'values'); - self::assertSame('#/components/schemas/PolicyValueMap', $values['$ref']); + self::assertSame([['$ref' => '#/components/schemas/PolicyValueMap']], $values['allOf']); + self::assertArrayNotHasKey('default', $values); $map = $spec['components']['schemas']['PolicyValueMap']; self::assertSame('object', $map['type']); self::assertSame('#/components/schemas/EffectivePolicyValue', $map['additionalProperties']['$ref']); diff --git a/tests/php/openapi/phpunit.xml b/tests/php/openapi/phpunit.xml index c9ec9062ea..d263b49ccc 100644 --- a/tests/php/openapi/phpunit.xml +++ b/tests/php/openapi/phpunit.xml @@ -15,6 +15,8 @@ OpenApiFunctionalTagsTest.php OpenApiGenerationTest.php + OpenApiExtractorSchemaTest.php + OpenApiPolicyValueTest.php OpenApiPolicyNumberUnionTest.php OpenApiRequestHeadersTest.php OpenApiSigningRequestContractsTest.php diff --git a/tests/sdk-generation/README.md b/tests/sdk-generation/README.md index 98b66ff0ef..10b6d9145b 100644 --- a/tests/sdk-generation/README.md +++ b/tests/sdk-generation/README.md @@ -80,3 +80,12 @@ development proxy; do not use it with remote systems. The PDF check reports a mark the run as failed but still allow the invalid-credentials check to run. That check requires HTTP 401; HTTP 403 and 429 do not count as authentication success for this negative test. + +## Policy value contract regression + +After regenerating the OpenAPI TypeScript types, run +`npm run test:policy-contract --prefix tests/sdk-generation` to check all eight +policy write contracts and the shared response value. This check uses the +published-contract types directly, independently of SDK generator workarounds. +It accepts heterogeneous nested object properties and explicit null, while +rejecting missing required values, top-level lists, functions and undefined. diff --git a/tests/sdk-generation/package.json b/tests/sdk-generation/package.json index f28958bec6..c973c4f132 100644 --- a/tests/sdk-generation/package.json +++ b/tests/sdk-generation/package.json @@ -9,7 +9,8 @@ "test:anyof": "tsc --noEmit --strict --skipLibCheck --target ES2020 --module commonjs --moduleResolution node anyof-defect.ts", "test:live": "tsx live.ts", "test:nextcloud": "node nextcloud-import.mjs", - "test:normalized": "tsc --noEmit --strict --skipLibCheck --target ES2020 --module commonjs --moduleResolution node ../../build/sdk-generation/normalized/typescript/*.ts normalized-types.ts" + "test:normalized": "tsc --noEmit --strict --skipLibCheck --target ES2020 --module commonjs --moduleResolution node ../../build/sdk-generation/normalized/typescript/*.ts normalized-types.ts", + "test:policy-contract": "tsc --noEmit --strict --skipLibCheck --target ES2020 --module commonjs --moduleResolution node policy-value-contracts.ts" }, "dependencies": { "@nextcloud/axios": "2.6.0", diff --git a/tests/sdk-generation/policy-value-contracts.ts b/tests/sdk-generation/policy-value-contracts.ts new file mode 100644 index 0000000000..b0e7358323 --- /dev/null +++ b/tests/sdk-generation/policy-value-contracts.ts @@ -0,0 +1,44 @@ +/* + * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +import type { components, operations } from '../../src/types/openapi/openapi-full' + +type Individual = 'policy-set-system' | 'policy-set-group' | 'policy-set-user-preference' | 'policy-set-user-policy-for-user' +type Compound = 'policy-set-system-compound' | 'policy-set-group-compound' | 'policy-set-user-preference-compound' | 'policy-set-user-policy-for-user-compound' +type Body = NonNullable['content']['application/json'] +type Value = components['schemas']['EffectivePolicyValue'] + +const objectValue = { enabled: false, approvers: ['admin'], nested: { mode: 'disabled' }, cleared: null } +const values = { custom: objectValue, reset: null, disabled: false, threshold: 1.5, label: 'Example' } +const individual = { + 'policy-set-system': { value: objectValue }, + 'policy-set-group': { value: objectValue }, + 'policy-set-user-preference': { value: objectValue }, + 'policy-set-user-policy-for-user': { value: objectValue }, +} satisfies { [K in Individual]: Body } +const compound = { + 'policy-set-system-compound': { values }, + 'policy-set-group-compound': { values }, + 'policy-set-user-preference-compound': { values }, + 'policy-set-user-policy-for-user-compound': { values }, +} satisfies { [K in Compound]: Body } +const reset = { + 'policy-set-system': { value: null }, + 'policy-set-group': { value: null }, + 'policy-set-user-preference': { value: null }, + 'policy-set-user-policy-for-user': { value: null }, +} satisfies { [K in Individual]: Body } +const responseValue: Value = objectValue +const explicitNull: Value = null +// @ts-expect-error individual writes still require value +const missingValue: Body<'policy-set-group'> = {} +// @ts-expect-error undefined cannot be persisted as a policy value +const undefinedValue: Value = undefined +// @ts-expect-error a policy value is not a top-level list +const listValue: Value = ['admin'] +// @ts-expect-error a policy value is not a function +const functionValue: Value = () => true +// @ts-expect-error compound values use the same contract +const invalidMap: components['schemas']['PolicyValueMap'] = { invalid: ['admin'] } +void [individual, compound, reset, responseValue, explicitNull, missingValue, undefinedValue, listValue, functionValue, invalidMap] diff --git a/vendor-bin/openapi-extractor/composer.json b/vendor-bin/openapi-extractor/composer.json index 4ddc47378e..29f6e9dfa6 100644 --- a/vendor-bin/openapi-extractor/composer.json +++ b/vendor-bin/openapi-extractor/composer.json @@ -1,10 +1,18 @@ { "require-dev": { + "cweagans/composer-patches": "^2.0", "nextcloud/openapi-extractor": "^1.9.1" }, "config": { + "allow-plugins": { + "cweagans/composer-patches": true + }, "platform": { "php": "8.3" - } + }, + "sort-packages": true + }, + "extra": { + "patches-file": "patches.json" } } diff --git a/vendor-bin/openapi-extractor/composer.lock b/vendor-bin/openapi-extractor/composer.lock index 04a03fd130..8d8535194e 100644 --- a/vendor-bin/openapi-extractor/composer.lock +++ b/vendor-bin/openapi-extractor/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cae1075073283e02a704b1d8758a78db", + "content-hash": "f4c2197f5cb7c96bef5edb8d31b2b0ab", "packages": [], "packages-dev": [ { @@ -81,6 +81,131 @@ "time": "2025-05-11T13:23:54+00:00", "published-time": "2025-05-12T02:34:26+00:00" }, + { + "name": "cweagans/composer-configurable-plugin", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-configurable-plugin.git", + "reference": "15433906511a108a1806710e988629fd24b89974" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-configurable-plugin/zipball/15433906511a108a1806710e988629fd24b89974", + "reference": "15433906511a108a1806710e988629fd24b89974", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "require-dev": { + "codeception/codeception": "~4.0", + "codeception/module-asserts": "^2.0", + "composer/composer": "~2.0", + "php-coveralls/php-coveralls": "~2.0", + "php-parallel-lint/php-parallel-lint": "^1.0.0", + "phpro/grumphp": "^1.8.0", + "sebastian/phpcpd": "^6.0", + "squizlabs/php_codesniffer": "^3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a lightweight configuration system for Composer plugins.", + "support": { + "issues": "https://github.com/cweagans/composer-configurable-plugin/issues", + "source": "https://github.com/cweagans/composer-configurable-plugin/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/cweagans", + "type": "github" + } + ], + "time": "2023-02-12T04:58:58+00:00", + "published-time": "2023-02-12T05:06:43+00:00" + }, + { + "name": "cweagans/composer-patches", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "bfa6018a5f864653d9ed899b902ea72f858a2cf7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/bfa6018a5f864653d9ed899b902ea72f858a2cf7", + "reference": "bfa6018a5f864653d9ed899b902ea72f858a2cf7", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "cweagans/composer-configurable-plugin": "^2.0", + "ext-json": "*", + "php": ">=8.0.0" + }, + "require-dev": { + "codeception/codeception": "~4.0", + "codeception/module-asserts": "^2.0", + "codeception/module-cli": "^2.0", + "codeception/module-filesystem": "^2.0", + "composer/composer": "~2.0", + "php-coveralls/php-coveralls": "~2.0", + "php-parallel-lint/php-parallel-lint": "^1.0.0", + "phpro/grumphp": "^1.8.0", + "sebastian/phpcpd": "^6.0", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "composer-plugin", + "extra": { + "_": "The following two lines ensure that composer-patches is loaded as early as possible.", + "class": "cweagans\\Composer\\Plugin\\Patches", + "plugin-modifies-downloads": true, + "plugin-modifies-install-path": true + }, + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "support": { + "issues": "https://github.com/cweagans/composer-patches/issues", + "source": "https://github.com/cweagans/composer-patches/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/cweagans", + "type": "github" + } + ], + "time": "2025-10-30T23:44:22+00:00", + "published-time": "2025-10-31T01:21:00+00:00" + }, { "name": "nextcloud/openapi-extractor", "version": "v1.9.1", diff --git a/vendor-bin/openapi-extractor/patches.json b/vendor-bin/openapi-extractor/patches.json new file mode 100644 index 0000000000..970ec785fc --- /dev/null +++ b/vendor-bin/openapi-extractor/patches.json @@ -0,0 +1,10 @@ +{ + "patches": { + "nextcloud/openapi-extractor": [ + { + "description": "Map array to unrestricted objects and keep schema keywords outside $ref", + "url": "../../.patches/openapi-extractor-mixed-object.diff" + } + ] + } +} diff --git a/vendor-bin/openapi-extractor/patches.lock.json b/vendor-bin/openapi-extractor/patches.lock.json new file mode 100644 index 0000000000..fe089b8405 --- /dev/null +++ b/vendor-bin/openapi-extractor/patches.lock.json @@ -0,0 +1,17 @@ +{ + "_hash": "b29e41dd7c6a166fc83488f014dd83d8bda51d8a4ccb97480576375df028511d", + "patches": { + "nextcloud/openapi-extractor": [ + { + "package": "nextcloud/openapi-extractor", + "description": "Map array to unrestricted objects and keep schema keywords outside $ref", + "url": "../../.patches/openapi-extractor-mixed-object.diff", + "sha256": "947d064d84cb5df80bde5c5ea298efa1efec97a65976ceb85de51cbe1b0b9dba", + "depth": 1, + "extra": { + "provenance": "patches-file:patches.json" + } + } + ] + } +}