From a1a626cb7b4960ef0a0b5a81004d22b71436a6db Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Sun, 3 Dec 2023 18:05:55 +0100 Subject: [PATCH] fix(dynamite): resolve arrays with a maximum length of 0 to BuiltList Signed-off-by: Nikolas Rimikis --- .../lib/src/builder/resolve_type.dart | 24 +- .../lib/types.openapi.dart | 86 ++++ .../lib/types.openapi.g.dart | 377 ++++++++++++++++++ .../lib/types.openapi.json | 59 +++ .../test/typestest.dart | 90 +++++ .../nextcloud/lib/src/api/core.openapi.dart | 45 +-- .../nextcloud/lib/src/api/core.openapi.json | 4 +- .../lib/src/api/sharebymail.openapi.dart | 23 +- .../lib/src/api/sharebymail.openapi.json | 4 +- .../nextcloud/lib/src/api/spreed.openapi.dart | 69 ++-- .../nextcloud/lib/src/api/spreed.openapi.json | 6 +- .../lib/src/api/user_status.openapi.dart | 27 +- .../lib/src/api/user_status.openapi.json | 2 +- .../sharebymail/0-oneof-workaround.json | 7 - ...ty-17.1.json => 0-compatibility-17.1.json} | 6 +- .../patches/spreed/0-oneof-workaround.json | 17 - ...ty-17.0.json => 1-compatibility-17.0.json} | 0 ...bility-16.json => 2-compatibility-16.json} | 4 +- ...bility-26.json => 0-compatibility-26.json} | 0 .../user_status/0-oneof-workaround.json | 7 - 20 files changed, 709 insertions(+), 148 deletions(-) create mode 100644 packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.dart create mode 100644 packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.g.dart create mode 100644 packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.json create mode 100644 packages/dynamite/dynamite_end_to_end_test/test/typestest.dart delete mode 100644 packages/nextcloud/lib/src/patches/sharebymail/0-oneof-workaround.json rename packages/nextcloud/lib/src/patches/spreed/{1-compatibility-17.1.json => 0-compatibility-17.1.json} (90%) delete mode 100644 packages/nextcloud/lib/src/patches/spreed/0-oneof-workaround.json rename packages/nextcloud/lib/src/patches/spreed/{2-compatibility-17.0.json => 1-compatibility-17.0.json} (100%) rename packages/nextcloud/lib/src/patches/spreed/{3-compatibility-16.json => 2-compatibility-16.json} (92%) rename packages/nextcloud/lib/src/patches/user_status/{1-compatibility-26.json => 0-compatibility-26.json} (100%) delete mode 100644 packages/nextcloud/lib/src/patches/user_status/0-oneof-workaround.json diff --git a/packages/dynamite/dynamite/lib/src/builder/resolve_type.dart b/packages/dynamite/dynamite/lib/src/builder/resolve_type.dart index 8f354fc83fb..b91d3b13d72 100644 --- a/packages/dynamite/dynamite/lib/src/builder/resolve_type.dart +++ b/packages/dynamite/dynamite/lib/src/builder/resolve_type.dart @@ -120,25 +120,25 @@ TypeResult resolveType( }; case openapi.SchemaType.array: - if (schema.items != null) { - final subResult = resolveType( + final TypeResult subResult; + if (schema.maxLength == 0) { + subResult = TypeResultBase('Never'); + } else if (schema.items != null) { + subResult = resolveType( spec, state, identifier, schema.items!, ); - result = TypeResultList( - 'BuiltList', - subResult, - nullable: nullable, - ); } else { - result = TypeResultList( - 'BuiltList', - TypeResultBase('JsonObject'), - nullable: nullable, - ); + subResult = TypeResultBase('JsonObject'); } + + result = TypeResultList( + 'BuiltList', + subResult, + nullable: nullable, + ); case openapi.SchemaType.object: if (schema.properties == null) { if (schema.additionalProperties == null) { diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.dart new file mode 100644 index 00000000000..f94092fef9c --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.dart @@ -0,0 +1,86 @@ +// ignore_for_file: camel_case_types +// ignore_for_file: discarded_futures +// ignore_for_file: public_member_api_docs +// ignore_for_file: unreachable_switch_case +import 'dart:typed_data'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:built_value/standard_json_plugin.dart'; +import 'package:dynamite_runtime/built_value.dart'; +import 'package:dynamite_runtime/http_client.dart'; +import 'package:dynamite_runtime/models.dart'; + +part 'types.openapi.g.dart'; + +class Client extends DynamiteClient { + Client( + super.baseURL, { + super.baseHeaders, + super.userAgent, + super.httpClient, + super.cookieJar, + }); + + Client.fromClient(final DynamiteClient client) + : super( + client.baseURL, + baseHeaders: client.baseHeaders, + httpClient: client.httpClient, + cookieJar: client.cookieJar, + authentications: client.authentications, + ); +} + +@BuiltValue(instantiable: false) +abstract interface class $BaseInterface { + @BuiltValueField(wireName: 'bool') + bool? get $bool; + int? get integer; + @BuiltValueField(wireName: 'double') + double? get $double; + @BuiltValueField(wireName: 'num') + num? get $num; + String? get string; + @BuiltValueField(wireName: 'content-string') + ContentString? get contentString; + @BuiltValueField(wireName: 'string-binary') + Uint8List? get stringBinary; + BuiltList? get list; + @BuiltValueField(wireName: 'list-never') + BuiltList? get listNever; + @BuiltValueField(wireName: 'list-string') + BuiltList? get listString; +} + +abstract class Base implements $BaseInterface, Built { + factory Base([final void Function(BaseBuilder)? b]) = _$Base; + + const Base._(); + + factory Base.fromJson(final Map json) => _jsonSerializers.deserializeWith(serializer, json)!; + + Map toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map; + + static Serializer get serializer => _$baseSerializer; +} + +// coverage:ignore-start +final Serializers _serializers = (Serializers().toBuilder() + ..addBuilderFactory(const FullType(Base), BaseBuilder.new) + ..add(Base.serializer) + ..addBuilderFactory(const FullType(ContentString, [FullType(int)]), ContentStringBuilder.new) + ..add(ContentString.serializer) + ..addBuilderFactory(const FullType(BuiltList, [FullType(JsonObject)]), ListBuilder.new) + ..addBuilderFactory(const FullType(BuiltList, [FullType(Never)]), ListBuilder.new) + ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), ListBuilder.new)) + .build(); + +final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) + ..addPlugin(StandardJsonPlugin()) + ..addPlugin(const ContentStringPlugin())) + .build(); +// coverage:ignore-end diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.g.dart b/packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.g.dart new file mode 100644 index 00000000000..8b7af9c2996 --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.g.dart @@ -0,0 +1,377 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'types.openapi.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +Serializer _$baseSerializer = _$BaseSerializer(); + +class _$BaseSerializer implements StructuredSerializer { + @override + final Iterable types = const [Base, _$Base]; + @override + final String wireName = 'Base'; + + @override + Iterable serialize(Serializers serializers, Base object, {FullType specifiedType = FullType.unspecified}) { + final result = []; + Object? value; + value = object.$bool; + if (value != null) { + result + ..add('bool') + ..add(serializers.serialize(value, specifiedType: const FullType(bool))); + } + value = object.integer; + if (value != null) { + result + ..add('integer') + ..add(serializers.serialize(value, specifiedType: const FullType(int))); + } + value = object.$double; + if (value != null) { + result + ..add('double') + ..add(serializers.serialize(value, specifiedType: const FullType(double))); + } + value = object.$num; + if (value != null) { + result + ..add('num') + ..add(serializers.serialize(value, specifiedType: const FullType(num))); + } + value = object.string; + if (value != null) { + result + ..add('string') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.contentString; + if (value != null) { + result + ..add('content-string') + ..add(serializers.serialize(value, specifiedType: const FullType(ContentString, [FullType(int)]))); + } + value = object.stringBinary; + if (value != null) { + result + ..add('string-binary') + ..add(serializers.serialize(value, specifiedType: const FullType(Uint8List))); + } + value = object.list; + if (value != null) { + result + ..add('list') + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]))); + } + value = object.listNever; + if (value != null) { + result + ..add('list-never') + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(Never)]))); + } + value = object.listString; + if (value != null) { + result + ..add('list-string') + ..add(serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(String)]))); + } + return result; + } + + @override + Base deserialize(Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = BaseBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'bool': + result.$bool = serializers.deserialize(value, specifiedType: const FullType(bool)) as bool?; + break; + case 'integer': + result.integer = serializers.deserialize(value, specifiedType: const FullType(int)) as int?; + break; + case 'double': + result.$double = serializers.deserialize(value, specifiedType: const FullType(double)) as double?; + break; + case 'num': + result.$num = serializers.deserialize(value, specifiedType: const FullType(num)) as num?; + break; + case 'string': + result.string = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'content-string': + result.contentString.replace(serializers.deserialize(value, + specifiedType: const FullType(ContentString, [FullType(int)]))! as ContentString); + break; + case 'string-binary': + result.stringBinary = serializers.deserialize(value, specifiedType: const FullType(Uint8List)) as Uint8List?; + break; + case 'list': + result.list.replace(serializers.deserialize(value, + specifiedType: const FullType(BuiltList, [FullType(JsonObject)]))! as BuiltList); + break; + case 'list-never': + result.listNever.replace(serializers.deserialize(value, + specifiedType: const FullType(BuiltList, [FullType(Never)]))! as BuiltList); + break; + case 'list-string': + result.listString.replace(serializers.deserialize(value, + specifiedType: const FullType(BuiltList, [FullType(String)]))! as BuiltList); + break; + } + } + + return result.build(); + } +} + +abstract mixin class $BaseInterfaceBuilder { + void replace($BaseInterface other); + void update(void Function($BaseInterfaceBuilder) updates); + bool? get $bool; + set $bool(bool? $bool); + + int? get integer; + set integer(int? integer); + + double? get $double; + set $double(double? $double); + + num? get $num; + set $num(num? $num); + + String? get string; + set string(String? string); + + ContentStringBuilder get contentString; + set contentString(ContentStringBuilder? contentString); + + Uint8List? get stringBinary; + set stringBinary(Uint8List? stringBinary); + + ListBuilder get list; + set list(ListBuilder? list); + + ListBuilder get listNever; + set listNever(ListBuilder? listNever); + + ListBuilder get listString; + set listString(ListBuilder? listString); +} + +class _$Base extends Base { + @override + final bool? $bool; + @override + final int? integer; + @override + final double? $double; + @override + final num? $num; + @override + final String? string; + @override + final ContentString? contentString; + @override + final Uint8List? stringBinary; + @override + final BuiltList? list; + @override + final BuiltList? listNever; + @override + final BuiltList? listString; + + factory _$Base([void Function(BaseBuilder)? updates]) => (BaseBuilder()..update(updates))._build(); + + _$Base._( + {this.$bool, + this.integer, + this.$double, + this.$num, + this.string, + this.contentString, + this.stringBinary, + this.list, + this.listNever, + this.listString}) + : super._(); + + @override + Base rebuild(void Function(BaseBuilder) updates) => (toBuilder()..update(updates)).build(); + + @override + BaseBuilder toBuilder() => BaseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is Base && + $bool == other.$bool && + integer == other.integer && + $double == other.$double && + $num == other.$num && + string == other.string && + contentString == other.contentString && + stringBinary == other.stringBinary && + list == other.list && + listNever == other.listNever && + listString == other.listString; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, $bool.hashCode); + _$hash = $jc(_$hash, integer.hashCode); + _$hash = $jc(_$hash, $double.hashCode); + _$hash = $jc(_$hash, $num.hashCode); + _$hash = $jc(_$hash, string.hashCode); + _$hash = $jc(_$hash, contentString.hashCode); + _$hash = $jc(_$hash, stringBinary.hashCode); + _$hash = $jc(_$hash, list.hashCode); + _$hash = $jc(_$hash, listNever.hashCode); + _$hash = $jc(_$hash, listString.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'Base') + ..add('\$bool', $bool) + ..add('integer', integer) + ..add('\$double', $double) + ..add('\$num', $num) + ..add('string', string) + ..add('contentString', contentString) + ..add('stringBinary', stringBinary) + ..add('list', list) + ..add('listNever', listNever) + ..add('listString', listString)) + .toString(); + } +} + +class BaseBuilder implements Builder, $BaseInterfaceBuilder { + _$Base? _$v; + + bool? _$bool; + bool? get $bool => _$this._$bool; + set $bool(covariant bool? $bool) => _$this._$bool = $bool; + + int? _integer; + int? get integer => _$this._integer; + set integer(covariant int? integer) => _$this._integer = integer; + + double? _$double; + double? get $double => _$this._$double; + set $double(covariant double? $double) => _$this._$double = $double; + + num? _$num; + num? get $num => _$this._$num; + set $num(covariant num? $num) => _$this._$num = $num; + + String? _string; + String? get string => _$this._string; + set string(covariant String? string) => _$this._string = string; + + ContentStringBuilder? _contentString; + ContentStringBuilder get contentString => _$this._contentString ??= ContentStringBuilder(); + set contentString(covariant ContentStringBuilder? contentString) => _$this._contentString = contentString; + + Uint8List? _stringBinary; + Uint8List? get stringBinary => _$this._stringBinary; + set stringBinary(covariant Uint8List? stringBinary) => _$this._stringBinary = stringBinary; + + ListBuilder? _list; + ListBuilder get list => _$this._list ??= ListBuilder(); + set list(covariant ListBuilder? list) => _$this._list = list; + + ListBuilder? _listNever; + ListBuilder get listNever => _$this._listNever ??= ListBuilder(); + set listNever(covariant ListBuilder? listNever) => _$this._listNever = listNever; + + ListBuilder? _listString; + ListBuilder get listString => _$this._listString ??= ListBuilder(); + set listString(covariant ListBuilder? listString) => _$this._listString = listString; + + BaseBuilder(); + + BaseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _$bool = $v.$bool; + _integer = $v.integer; + _$double = $v.$double; + _$num = $v.$num; + _string = $v.string; + _contentString = $v.contentString?.toBuilder(); + _stringBinary = $v.stringBinary; + _list = $v.list?.toBuilder(); + _listNever = $v.listNever?.toBuilder(); + _listString = $v.listString?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(covariant Base other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$Base; + } + + @override + void update(void Function(BaseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + Base build() => _build(); + + _$Base _build() { + _$Base _$result; + try { + _$result = _$v ?? + _$Base._( + $bool: $bool, + integer: integer, + $double: $double, + $num: $num, + string: string, + contentString: _contentString?.build(), + stringBinary: stringBinary, + list: _list?.build(), + listNever: _listNever?.build(), + listString: _listString?.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'contentString'; + _contentString?.build(); + + _$failedField = 'list'; + _list?.build(); + _$failedField = 'listNever'; + _listNever?.build(); + _$failedField = 'listString'; + _listString?.build(); + } catch (e) { + throw BuiltValueNestedFieldError(r'Base', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.json b/packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.json new file mode 100644 index 00000000000..47b500be45c --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/lib/types.openapi.json @@ -0,0 +1,59 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Test type resolving", + "version": "0.0.1" + }, + "components": { + "schemas": { + "Base": { + "type": "object", + "properties": { + "bool": { + "type": "boolean" + }, + "integer": { + "type": "integer" + }, + "double": { + "type": "number", + "format": "float" + }, + "num": { + "type": "number" + }, + "string": { + "type": "string" + }, + "content-string": { + "type": "string", + "nullable": true, + "contentMediaType": "application/json", + "contentSchema": { + "type": "integer" + } + }, + "string-binary": { + "type": "string", + "format": "binary" + }, + "list": { + "type": "array" + }, + "list-never": { + "type": "array", + "maxLength": 0 + }, + "list-string": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "paths": {}, + "tags": [] +} diff --git a/packages/dynamite/dynamite_end_to_end_test/test/typestest.dart b/packages/dynamite/dynamite_end_to_end_test/test/typestest.dart new file mode 100644 index 00000000000..83a884e2321 --- /dev/null +++ b/packages/dynamite/dynamite_end_to_end_test/test/typestest.dart @@ -0,0 +1,90 @@ +import 'dart:convert'; + +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/serializer.dart'; +import 'package:dynamite_end_to_end_test/types.openapi.dart'; +import 'package:test/test.dart'; + +void main() { + test(Base, () { + final object = Base( + (final b) => b + ..$bool = true + ..integer = 350 + ..$double = 0.7617818016335848 + ..$num = 0.6538342555284606 + ..string = 'StringValue' + ..contentString.update((final b) => b..content = 98) + ..stringBinary = utf8.encode('StringValue') + ..list.update( + (final b) => b + ..addAll([ + JsonObject('value'), + JsonObject(188), + JsonObject(0.45151780411979836), + JsonObject(false), + ]), + ) + ..listNever = ListBuilder() + ..listString.update( + (final b) => b + ..addAll([ + 'value1', + 'value2', + 'value3', + 'value4', + ]), + ), + ); + + final json = { + 'bool': true, + 'integer': 350, + 'double': 0.7617818016335848, + 'num': 0.6538342555284606, + 'string': 'StringValue', + 'content-string': '98', + 'string-binary': 'U3RyaW5nVmFsdWU=', + 'list': ['value', 188, 0.45151780411979836, false], + // ignore: inference_failure_on_collection_literal + 'list-never': [], + 'list-string': ['value1', 'value2', 'value3', 'value4'], + }; + final revived = Base.fromJson(json); + + expect(object.toJson(), equals(json)); + + expect(revived.$bool, equals(object.$bool)); + expect(revived.integer, equals(object.integer)); + expect(revived.$double, equals(object.$double)); + expect(revived.$num, equals(object.$num)); + expect(revived.string, equals(object.string)); + expect(revived.contentString, equals(object.contentString)); + expect(revived.stringBinary, equals(object.stringBinary)); + expect(revived.list, equals(object.list)); + expect(revived.listNever, equals(object.listNever)); + expect(revived.listString, equals(object.listString)); + }); + + test(BuiltList, () { + final object = Base( + (final b) => b..listNever = ListBuilder(), + ); + + var json = { + // ignore: inference_failure_on_collection_literal + 'list-never': [], + }; + + final revived = Base.fromJson(json); + expect(object.toJson(), equals(json)); + expect(revived.listNever, equals(object.listNever)); + + json = { + 'list-never': ['SomeValue'], + }; + + expect(() => Base.fromJson(json), throwsA(isA())); + }); +} diff --git a/packages/nextcloud/lib/src/api/core.openapi.dart b/packages/nextcloud/lib/src/api/core.openapi.dart index 311fc592ec1..2366dc6411d 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.dart +++ b/packages/nextcloud/lib/src/api/core.openapi.dart @@ -10726,12 +10726,12 @@ typedef AutocompleteResult_Status = ({AutocompleteResult_Status0? autocompleteRe typedef NavigationEntry_Order = ({int? $int, String? string}); typedef SharebymailCapabilities = ({ - BuiltList? builtListJsonObject, + BuiltList? builtListNever, SharebymailCapabilities0? sharebymailCapabilities0 }); typedef SpreedPublicCapabilities = ({ - BuiltList? builtListJsonObject, + BuiltList? builtListNever, SpreedPublicCapabilities0? spreedPublicCapabilities0 }); @@ -10876,12 +10876,12 @@ class _$IntStringSerializer implements PrimitiveSerializer<$IntString> { } typedef $BuiltListSharebymailCapabilities0 = ({ - BuiltList? builtListJsonObject, + BuiltList? builtListNever, SharebymailCapabilities0? sharebymailCapabilities0 }); extension $BuiltListSharebymailCapabilities0Extension on $BuiltListSharebymailCapabilities0 { - List get _values => [builtListJsonObject, sharebymailCapabilities0]; + List get _values => [builtListNever, sharebymailCapabilities0]; void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values); static Serializer<$BuiltListSharebymailCapabilities0> get serializer => @@ -10907,9 +10907,9 @@ class _$BuiltListSharebymailCapabilities0Serializer implements PrimitiveSerializ final FullType specifiedType = FullType.unspecified, }) { dynamic value; - value = object.builtListJsonObject; + value = object.builtListNever; if (value != null) { - return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]))!; + return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(Never)]))!; } value = object.sharebymailCapabilities0; if (value != null) { @@ -10925,29 +10925,27 @@ class _$BuiltListSharebymailCapabilities0Serializer implements PrimitiveSerializ final Object data, { final FullType specifiedType = FullType.unspecified, }) { - BuiltList? builtListJsonObject; + BuiltList? builtListNever; try { - builtListJsonObject = serializers.deserialize( - data, - specifiedType: const FullType(BuiltList, [FullType(JsonObject)]), - )! as BuiltList; + builtListNever = serializers.deserialize(data, specifiedType: const FullType(BuiltList, [FullType(Never)]))! + as BuiltList; } catch (_) {} SharebymailCapabilities0? sharebymailCapabilities0; try { sharebymailCapabilities0 = serializers.deserialize(data, specifiedType: const FullType(SharebymailCapabilities0))! as SharebymailCapabilities0; } catch (_) {} - return (builtListJsonObject: builtListJsonObject, sharebymailCapabilities0: sharebymailCapabilities0); + return (builtListNever: builtListNever, sharebymailCapabilities0: sharebymailCapabilities0); } } typedef $BuiltListSpreedPublicCapabilities0 = ({ - BuiltList? builtListJsonObject, + BuiltList? builtListNever, SpreedPublicCapabilities0? spreedPublicCapabilities0 }); extension $BuiltListSpreedPublicCapabilities0Extension on $BuiltListSpreedPublicCapabilities0 { - List get _values => [builtListJsonObject, spreedPublicCapabilities0]; + List get _values => [builtListNever, spreedPublicCapabilities0]; void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values); static Serializer<$BuiltListSpreedPublicCapabilities0> get serializer => @@ -10974,9 +10972,9 @@ class _$BuiltListSpreedPublicCapabilities0Serializer final FullType specifiedType = FullType.unspecified, }) { dynamic value; - value = object.builtListJsonObject; + value = object.builtListNever; if (value != null) { - return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]))!; + return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(Never)]))!; } value = object.spreedPublicCapabilities0; if (value != null) { @@ -10992,12 +10990,10 @@ class _$BuiltListSpreedPublicCapabilities0Serializer final Object data, { final FullType specifiedType = FullType.unspecified, }) { - BuiltList? builtListJsonObject; + BuiltList? builtListNever; try { - builtListJsonObject = serializers.deserialize( - data, - specifiedType: const FullType(BuiltList, [FullType(JsonObject)]), - )! as BuiltList; + builtListNever = serializers.deserialize(data, specifiedType: const FullType(BuiltList, [FullType(Never)]))! + as BuiltList; } catch (_) {} SpreedPublicCapabilities0? spreedPublicCapabilities0; try { @@ -11006,7 +11002,7 @@ class _$BuiltListSpreedPublicCapabilities0Serializer specifiedType: const FullType(SpreedPublicCapabilities0), )! as SpreedPublicCapabilities0; } catch (_) {} - return (builtListJsonObject: builtListJsonObject, spreedPublicCapabilities0: spreedPublicCapabilities0); + return (builtListNever: builtListNever, spreedPublicCapabilities0: spreedPublicCapabilities0); } } @@ -11204,7 +11200,7 @@ class _$CommentsCapabilitiesDavCapabilitiesFilesCapabilitiesFilesSharingCapabili try { sharebymailCapabilities = ((serializers.deserialize(data, specifiedType: const FullType(SharebymailCapabilities))! as SharebymailCapabilities) - ..validateAnyOf()); + ..validateOneOf()); } catch (_) {} SpreedPublicCapabilities? spreedPublicCapabilities; try { @@ -11212,7 +11208,7 @@ class _$CommentsCapabilitiesDavCapabilitiesFilesCapabilitiesFilesSharingCapabili data, specifiedType: const FullType(SpreedPublicCapabilities), )! as SpreedPublicCapabilities) - ..validateAnyOf()); + ..validateOneOf()); } catch (_) {} ThemingPublicCapabilities? themingPublicCapabilities; try { @@ -11640,6 +11636,7 @@ final Serializers _serializers = (Serializers().toBuilder() SharebymailCapabilities0_FilesSharing_Sharebymail_ExpireDateBuilder.new, ) ..add(SharebymailCapabilities0_FilesSharing_Sharebymail_ExpireDate.serializer) + ..addBuilderFactory(const FullType(BuiltList, [FullType(Never)]), ListBuilder.new) ..add($BuiltListSharebymailCapabilities0Extension.serializer) ..addBuilderFactory(const FullType(SpreedPublicCapabilities0), SpreedPublicCapabilities0Builder.new) ..add(SpreedPublicCapabilities0.serializer) diff --git a/packages/nextcloud/lib/src/api/core.openapi.json b/packages/nextcloud/lib/src/api/core.openapi.json index 5ee52a46d0a..bb60329be51 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.json +++ b/packages/nextcloud/lib/src/api/core.openapi.json @@ -1039,7 +1039,7 @@ } }, "SharebymailCapabilities": { - "anyOf": [ + "oneOf": [ { "type": "object", "required": [ @@ -1122,7 +1122,7 @@ ] }, "SpreedPublicCapabilities": { - "anyOf": [ + "oneOf": [ { "type": "object", "required": [ diff --git a/packages/nextcloud/lib/src/api/sharebymail.openapi.dart b/packages/nextcloud/lib/src/api/sharebymail.openapi.dart index 35f5df188ec..214f6365d42 100644 --- a/packages/nextcloud/lib/src/api/sharebymail.openapi.dart +++ b/packages/nextcloud/lib/src/api/sharebymail.openapi.dart @@ -6,7 +6,6 @@ import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; -import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:dynamite_runtime/built_value.dart'; @@ -219,12 +218,12 @@ abstract class Capabilities0 implements $Capabilities0Interface, Built get serializer => _$capabilities0Serializer; } -typedef Capabilities = ({BuiltList? builtListJsonObject, Capabilities0? capabilities0}); +typedef Capabilities = ({BuiltList? builtListNever, Capabilities0? capabilities0}); -typedef $BuiltListCapabilities0 = ({BuiltList? builtListJsonObject, Capabilities0? capabilities0}); +typedef $BuiltListCapabilities0 = ({BuiltList? builtListNever, Capabilities0? capabilities0}); extension $BuiltListCapabilities0Extension on $BuiltListCapabilities0 { - List get _values => [builtListJsonObject, capabilities0]; + List get _values => [builtListNever, capabilities0]; void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values); static Serializer<$BuiltListCapabilities0> get serializer => const _$BuiltListCapabilities0Serializer(); @@ -248,9 +247,9 @@ class _$BuiltListCapabilities0Serializer implements PrimitiveSerializer<$BuiltLi final FullType specifiedType = FullType.unspecified, }) { dynamic value; - value = object.builtListJsonObject; + value = object.builtListNever; if (value != null) { - return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]))!; + return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(Never)]))!; } value = object.capabilities0; if (value != null) { @@ -266,18 +265,16 @@ class _$BuiltListCapabilities0Serializer implements PrimitiveSerializer<$BuiltLi final Object data, { final FullType specifiedType = FullType.unspecified, }) { - BuiltList? builtListJsonObject; + BuiltList? builtListNever; try { - builtListJsonObject = serializers.deserialize( - data, - specifiedType: const FullType(BuiltList, [FullType(JsonObject)]), - )! as BuiltList; + builtListNever = serializers.deserialize(data, specifiedType: const FullType(BuiltList, [FullType(Never)]))! + as BuiltList; } catch (_) {} Capabilities0? capabilities0; try { capabilities0 = serializers.deserialize(data, specifiedType: const FullType(Capabilities0))! as Capabilities0; } catch (_) {} - return (builtListJsonObject: builtListJsonObject, capabilities0: capabilities0); + return (builtListNever: builtListNever, capabilities0: capabilities0); } } @@ -307,7 +304,7 @@ final Serializers _serializers = (Serializers().toBuilder() Capabilities0_FilesSharing_Sharebymail_ExpireDateBuilder.new, ) ..add(Capabilities0_FilesSharing_Sharebymail_ExpireDate.serializer) - ..addBuilderFactory(const FullType(BuiltList, [FullType(JsonObject)]), ListBuilder.new) + ..addBuilderFactory(const FullType(BuiltList, [FullType(Never)]), ListBuilder.new) ..add($BuiltListCapabilities0Extension.serializer)) .build(); diff --git a/packages/nextcloud/lib/src/api/sharebymail.openapi.json b/packages/nextcloud/lib/src/api/sharebymail.openapi.json index c6a3671387d..81eff703c46 100644 --- a/packages/nextcloud/lib/src/api/sharebymail.openapi.json +++ b/packages/nextcloud/lib/src/api/sharebymail.openapi.json @@ -22,7 +22,7 @@ }, "schemas": { "Capabilities": { - "anyOf": [ + "oneOf": [ { "type": "object", "required": [ @@ -108,4 +108,4 @@ }, "paths": {}, "tags": [] -} +} \ No newline at end of file diff --git a/packages/nextcloud/lib/src/api/spreed.openapi.dart b/packages/nextcloud/lib/src/api/spreed.openapi.dart index c39dcd0125e..a5c42eb6a7e 100644 --- a/packages/nextcloud/lib/src/api/spreed.openapi.dart +++ b/packages/nextcloud/lib/src/api/spreed.openapi.dart @@ -12942,7 +12942,7 @@ abstract class Room implements $RoomInterface, Built { @BuiltValueHook(finalizeBuilder: true) static void _validate(final RoomBuilder b) { - b.lastMessage?.validateAnyOf(); + b.lastMessage?.validateOneOf(); } } @@ -20470,7 +20470,7 @@ abstract class RoomAddParticipantToRoomResponseApplicationJson_Ocs @BuiltValueHook(finalizeBuilder: true) static void _validate(final RoomAddParticipantToRoomResponseApplicationJson_OcsBuilder b) { - b.data?.validateAnyOf(); + b.data?.validateOneOf(); } } @@ -23149,10 +23149,10 @@ abstract class PublicCapabilities0 static Serializer get serializer => _$publicCapabilities0Serializer; } -typedef Room_LastMessage = ({BuiltList? builtListJsonObject, ChatMessage? chatMessage}); +typedef Room_LastMessage = ({BuiltList? builtListNever, ChatMessage? chatMessage}); typedef RoomAddParticipantToRoomResponseApplicationJson_Ocs_Data = ({ - BuiltList? builtListJsonObject, + BuiltList? builtListNever, RoomAddParticipantToRoomResponseApplicationJson_Ocs_Data0? roomAddParticipantToRoomResponseApplicationJsonOcsData0 }); @@ -23163,12 +23163,12 @@ typedef SignalingPullMessagesResponseApplicationJson_Ocs_Data_Data = ({ String? string }); -typedef PublicCapabilities = ({BuiltList? builtListJsonObject, PublicCapabilities0? publicCapabilities0}); +typedef PublicCapabilities = ({BuiltList? builtListNever, PublicCapabilities0? publicCapabilities0}); -typedef $BuiltListChatMessage = ({BuiltList? builtListJsonObject, ChatMessage? chatMessage}); +typedef $BuiltListChatMessage = ({BuiltList? builtListNever, ChatMessage? chatMessage}); extension $BuiltListChatMessageExtension on $BuiltListChatMessage { - List get _values => [builtListJsonObject, chatMessage]; + List get _values => [builtListNever, chatMessage]; void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values); static Serializer<$BuiltListChatMessage> get serializer => const _$BuiltListChatMessageSerializer(); @@ -23192,9 +23192,9 @@ class _$BuiltListChatMessageSerializer implements PrimitiveSerializer<$BuiltList final FullType specifiedType = FullType.unspecified, }) { dynamic value; - value = object.builtListJsonObject; + value = object.builtListNever; if (value != null) { - return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]))!; + return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(Never)]))!; } value = object.chatMessage; if (value != null) { @@ -23210,29 +23210,27 @@ class _$BuiltListChatMessageSerializer implements PrimitiveSerializer<$BuiltList final Object data, { final FullType specifiedType = FullType.unspecified, }) { - BuiltList? builtListJsonObject; + BuiltList? builtListNever; try { - builtListJsonObject = serializers.deserialize( - data, - specifiedType: const FullType(BuiltList, [FullType(JsonObject)]), - )! as BuiltList; + builtListNever = serializers.deserialize(data, specifiedType: const FullType(BuiltList, [FullType(Never)]))! + as BuiltList; } catch (_) {} ChatMessage? chatMessage; try { chatMessage = serializers.deserialize(data, specifiedType: const FullType(ChatMessage))! as ChatMessage; } catch (_) {} - return (builtListJsonObject: builtListJsonObject, chatMessage: chatMessage); + return (builtListNever: builtListNever, chatMessage: chatMessage); } } typedef $BuiltListRoomAddParticipantToRoomResponseApplicationJsonOcsData0 = ({ - BuiltList? builtListJsonObject, + BuiltList? builtListNever, RoomAddParticipantToRoomResponseApplicationJson_Ocs_Data0? roomAddParticipantToRoomResponseApplicationJsonOcsData0 }); extension $BuiltListRoomAddParticipantToRoomResponseApplicationJsonOcsData0Extension on $BuiltListRoomAddParticipantToRoomResponseApplicationJsonOcsData0 { - List get _values => [builtListJsonObject, roomAddParticipantToRoomResponseApplicationJsonOcsData0]; + List get _values => [builtListNever, roomAddParticipantToRoomResponseApplicationJsonOcsData0]; void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values); static Serializer<$BuiltListRoomAddParticipantToRoomResponseApplicationJsonOcsData0> get serializer => @@ -23259,9 +23257,9 @@ class _$BuiltListRoomAddParticipantToRoomResponseApplicationJsonOcsData0Serializ final FullType specifiedType = FullType.unspecified, }) { dynamic value; - value = object.builtListJsonObject; + value = object.builtListNever; if (value != null) { - return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]))!; + return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(Never)]))!; } value = object.roomAddParticipantToRoomResponseApplicationJsonOcsData0; if (value != null) { @@ -23280,12 +23278,10 @@ class _$BuiltListRoomAddParticipantToRoomResponseApplicationJsonOcsData0Serializ final Object data, { final FullType specifiedType = FullType.unspecified, }) { - BuiltList? builtListJsonObject; + BuiltList? builtListNever; try { - builtListJsonObject = serializers.deserialize( - data, - specifiedType: const FullType(BuiltList, [FullType(JsonObject)]), - )! as BuiltList; + builtListNever = serializers.deserialize(data, specifiedType: const FullType(BuiltList, [FullType(Never)]))! + as BuiltList; } catch (_) {} RoomAddParticipantToRoomResponseApplicationJson_Ocs_Data0? roomAddParticipantToRoomResponseApplicationJsonOcsData0; try { @@ -23295,7 +23291,7 @@ class _$BuiltListRoomAddParticipantToRoomResponseApplicationJsonOcsData0Serializ )! as RoomAddParticipantToRoomResponseApplicationJson_Ocs_Data0; } catch (_) {} return ( - builtListJsonObject: builtListJsonObject, + builtListNever: builtListNever, roomAddParticipantToRoomResponseApplicationJsonOcsData0: roomAddParticipantToRoomResponseApplicationJsonOcsData0 ); } @@ -23418,13 +23414,10 @@ class _$BuiltListStringSerializer implements PrimitiveSerializer<$BuiltListStrin } } -typedef $BuiltListPublicCapabilities0 = ({ - BuiltList? builtListJsonObject, - PublicCapabilities0? publicCapabilities0 -}); +typedef $BuiltListPublicCapabilities0 = ({BuiltList? builtListNever, PublicCapabilities0? publicCapabilities0}); extension $BuiltListPublicCapabilities0Extension on $BuiltListPublicCapabilities0 { - List get _values => [builtListJsonObject, publicCapabilities0]; + List get _values => [builtListNever, publicCapabilities0]; void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values); static Serializer<$BuiltListPublicCapabilities0> get serializer => const _$BuiltListPublicCapabilities0Serializer(); @@ -23449,9 +23442,9 @@ class _$BuiltListPublicCapabilities0Serializer implements PrimitiveSerializer<$B final FullType specifiedType = FullType.unspecified, }) { dynamic value; - value = object.builtListJsonObject; + value = object.builtListNever; if (value != null) { - return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]))!; + return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(Never)]))!; } value = object.publicCapabilities0; if (value != null) { @@ -23467,19 +23460,17 @@ class _$BuiltListPublicCapabilities0Serializer implements PrimitiveSerializer<$B final Object data, { final FullType specifiedType = FullType.unspecified, }) { - BuiltList? builtListJsonObject; + BuiltList? builtListNever; try { - builtListJsonObject = serializers.deserialize( - data, - specifiedType: const FullType(BuiltList, [FullType(JsonObject)]), - )! as BuiltList; + builtListNever = serializers.deserialize(data, specifiedType: const FullType(BuiltList, [FullType(Never)]))! + as BuiltList; } catch (_) {} PublicCapabilities0? publicCapabilities0; try { publicCapabilities0 = serializers.deserialize(data, specifiedType: const FullType(PublicCapabilities0))! as PublicCapabilities0; } catch (_) {} - return (builtListJsonObject: builtListJsonObject, publicCapabilities0: publicCapabilities0); + return (builtListNever: builtListNever, publicCapabilities0: publicCapabilities0); } } @@ -23515,7 +23506,7 @@ final Serializers _serializers = (Serializers().toBuilder() MapBuilder>.new, ) ..addBuilderFactory(const FullType(BuiltMap, [FullType(String), FullType(int)]), MapBuilder.new) - ..addBuilderFactory(const FullType(BuiltList, [FullType(JsonObject)]), ListBuilder.new) + ..addBuilderFactory(const FullType(BuiltList, [FullType(Never)]), ListBuilder.new) ..add($BuiltListChatMessageExtension.serializer) ..add(AvatarDeleteAvatarApiVersion.serializer) ..addBuilderFactory( diff --git a/packages/nextcloud/lib/src/api/spreed.openapi.json b/packages/nextcloud/lib/src/api/spreed.openapi.json index 8102acb46f1..5703528e3fe 100644 --- a/packages/nextcloud/lib/src/api/spreed.openapi.json +++ b/packages/nextcloud/lib/src/api/spreed.openapi.json @@ -602,7 +602,7 @@ } }, "PublicCapabilities": { - "anyOf": [ + "oneOf": [ { "type": "object", "required": [ @@ -947,7 +947,7 @@ "format": "int64" }, "lastMessage": { - "anyOf": [ + "oneOf": [ { "$ref": "#/components/schemas/ChatMessage" }, @@ -12890,7 +12890,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "anyOf": [ + "oneOf": [ { "type": "object", "required": [ diff --git a/packages/nextcloud/lib/src/api/user_status.openapi.dart b/packages/nextcloud/lib/src/api/user_status.openapi.dart index 68ab08f701c..368ded2c4f5 100644 --- a/packages/nextcloud/lib/src/api/user_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/user_status.openapi.dart @@ -1790,7 +1790,7 @@ abstract class UserStatusRevertStatusResponseApplicationJson_Ocs @BuiltValueHook(finalizeBuilder: true) static void _validate(final UserStatusRevertStatusResponseApplicationJson_OcsBuilder b) { - b.data?.validateAnyOf(); + b.data?.validateOneOf(); } } @@ -1878,10 +1878,7 @@ abstract class Capabilities implements $CapabilitiesInterface, Built? builtListJsonObject, - Private? private -}); +typedef UserStatusRevertStatusResponseApplicationJson_Ocs_Data = ({BuiltList? builtListNever, Private? private}); typedef $ClearAtTimeTypeInt = ({ClearAtTimeType? clearAtTimeType, int? $int}); @@ -1941,10 +1938,10 @@ class _$ClearAtTimeTypeIntSerializer implements PrimitiveSerializer<$ClearAtTime } } -typedef $BuiltListPrivate = ({BuiltList? builtListJsonObject, Private? private}); +typedef $BuiltListPrivate = ({BuiltList? builtListNever, Private? private}); extension $BuiltListPrivateExtension on $BuiltListPrivate { - List get _values => [builtListJsonObject, private]; + List get _values => [builtListNever, private]; void validateOneOf() => dynamite_utils.validateOneOf(_values); void validateAnyOf() => dynamite_utils.validateAnyOf(_values); static Serializer<$BuiltListPrivate> get serializer => const _$BuiltListPrivateSerializer(); @@ -1968,9 +1965,9 @@ class _$BuiltListPrivateSerializer implements PrimitiveSerializer<$BuiltListPriv final FullType specifiedType = FullType.unspecified, }) { dynamic value; - value = object.builtListJsonObject; + value = object.builtListNever; if (value != null) { - return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(JsonObject)]))!; + return serializers.serialize(value, specifiedType: const FullType(BuiltList, [FullType(Never)]))!; } value = object.private; if (value != null) { @@ -1986,18 +1983,16 @@ class _$BuiltListPrivateSerializer implements PrimitiveSerializer<$BuiltListPriv final Object data, { final FullType specifiedType = FullType.unspecified, }) { - BuiltList? builtListJsonObject; + BuiltList? builtListNever; try { - builtListJsonObject = serializers.deserialize( - data, - specifiedType: const FullType(BuiltList, [FullType(JsonObject)]), - )! as BuiltList; + builtListNever = serializers.deserialize(data, specifiedType: const FullType(BuiltList, [FullType(Never)]))! + as BuiltList; } catch (_) {} Private? private; try { private = serializers.deserialize(data, specifiedType: const FullType(Private))! as Private; } catch (_) {} - return (builtListJsonObject: builtListJsonObject, private: private); + return (builtListNever: builtListNever, private: private); } } @@ -2118,7 +2113,7 @@ final Serializers _serializers = (Serializers().toBuilder() UserStatusRevertStatusResponseApplicationJson_OcsBuilder.new, ) ..add(UserStatusRevertStatusResponseApplicationJson_Ocs.serializer) - ..addBuilderFactory(const FullType(BuiltList, [FullType(JsonObject)]), ListBuilder.new) + ..addBuilderFactory(const FullType(BuiltList, [FullType(Never)]), ListBuilder.new) ..add($BuiltListPrivateExtension.serializer) ..addBuilderFactory(const FullType(Capabilities), CapabilitiesBuilder.new) ..add(Capabilities.serializer) diff --git a/packages/nextcloud/lib/src/api/user_status.openapi.json b/packages/nextcloud/lib/src/api/user_status.openapi.json index 2da0d67843a..9a6f3263b80 100644 --- a/packages/nextcloud/lib/src/api/user_status.openapi.json +++ b/packages/nextcloud/lib/src/api/user_status.openapi.json @@ -816,7 +816,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "anyOf": [ + "oneOf": [ { "$ref": "#/components/schemas/Private" }, diff --git a/packages/nextcloud/lib/src/patches/sharebymail/0-oneof-workaround.json b/packages/nextcloud/lib/src/patches/sharebymail/0-oneof-workaround.json deleted file mode 100644 index 8eb3eebc928..00000000000 --- a/packages/nextcloud/lib/src/patches/sharebymail/0-oneof-workaround.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "op": "move", - "from": "/components/schemas/Capabilities/oneOf", - "path": "/components/schemas/Capabilities/anyOf" - } -] diff --git a/packages/nextcloud/lib/src/patches/spreed/1-compatibility-17.1.json b/packages/nextcloud/lib/src/patches/spreed/0-compatibility-17.1.json similarity index 90% rename from packages/nextcloud/lib/src/patches/spreed/1-compatibility-17.1.json rename to packages/nextcloud/lib/src/patches/spreed/0-compatibility-17.1.json index c3df7f0cf0e..a737b221fa5 100644 --- a/packages/nextcloud/lib/src/patches/spreed/1-compatibility-17.1.json +++ b/packages/nextcloud/lib/src/patches/spreed/0-compatibility-17.1.json @@ -1,7 +1,7 @@ [ { "op": "replace", - "path": "/components/schemas/PublicCapabilities/anyOf/0/properties/spreed/properties/config/properties/call/required", + "path": "/components/schemas/PublicCapabilities/oneOf/0/properties/spreed/properties/config/properties/call/required", "value": [ "enabled", "breakout-rooms", @@ -13,7 +13,7 @@ }, { "op": "replace", - "path": "/components/schemas/PublicCapabilities/anyOf/0/properties/spreed/properties/config/properties/chat/required", + "path": "/components/schemas/PublicCapabilities/oneOf/0/properties/spreed/properties/config/properties/chat/required", "value": [ "max-length", "read-privacy", @@ -22,7 +22,7 @@ }, { "op": "add", - "path": "/components/schemas/PublicCapabilities/anyOf/0/properties/spreed/properties/config/properties/chat/properties/translations", + "path": "/components/schemas/PublicCapabilities/oneOf/0/properties/spreed/properties/config/properties/chat/properties/translations", "value": { "type": "array", "items": { diff --git a/packages/nextcloud/lib/src/patches/spreed/0-oneof-workaround.json b/packages/nextcloud/lib/src/patches/spreed/0-oneof-workaround.json deleted file mode 100644 index 57018875087..00000000000 --- a/packages/nextcloud/lib/src/patches/spreed/0-oneof-workaround.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "op": "move", - "from": "/components/schemas/PublicCapabilities/oneOf", - "path": "/components/schemas/PublicCapabilities/anyOf" - }, - { - "op": "move", - "from": "/components/schemas/Room/properties/lastMessage/oneOf", - "path": "/components/schemas/Room/properties/lastMessage/anyOf" - }, - { - "op": "move", - "from": "/paths/~1ocs~1v2.php~1apps~1spreed~1api~1{apiVersion}~1room~1{token}~1participants/post/responses/200/content/application~1json/schema/properties/ocs/properties/data/oneOf", - "path": "/paths/~1ocs~1v2.php~1apps~1spreed~1api~1{apiVersion}~1room~1{token}~1participants/post/responses/200/content/application~1json/schema/properties/ocs/properties/data/anyOf" - } -] diff --git a/packages/nextcloud/lib/src/patches/spreed/2-compatibility-17.0.json b/packages/nextcloud/lib/src/patches/spreed/1-compatibility-17.0.json similarity index 100% rename from packages/nextcloud/lib/src/patches/spreed/2-compatibility-17.0.json rename to packages/nextcloud/lib/src/patches/spreed/1-compatibility-17.0.json diff --git a/packages/nextcloud/lib/src/patches/spreed/3-compatibility-16.json b/packages/nextcloud/lib/src/patches/spreed/2-compatibility-16.json similarity index 92% rename from packages/nextcloud/lib/src/patches/spreed/3-compatibility-16.json rename to packages/nextcloud/lib/src/patches/spreed/2-compatibility-16.json index a1ede8f6d61..243c0f898cd 100644 --- a/packages/nextcloud/lib/src/patches/spreed/3-compatibility-16.json +++ b/packages/nextcloud/lib/src/patches/spreed/2-compatibility-16.json @@ -1,7 +1,7 @@ [ { "op": "replace", - "path": "/components/schemas/PublicCapabilities/anyOf/0/properties/spreed/properties/config/properties/call/required", + "path": "/components/schemas/PublicCapabilities/oneOf/0/properties/spreed/properties/config/properties/call/required", "value": [ "enabled", "breakout-rooms", @@ -10,7 +10,7 @@ }, { "op": "replace", - "path": "/components/schemas/PublicCapabilities/anyOf/0/properties/spreed/properties/config/properties/chat/required", + "path": "/components/schemas/PublicCapabilities/oneOf/0/properties/spreed/properties/config/properties/chat/required", "value": [ "max-length", "read-privacy" diff --git a/packages/nextcloud/lib/src/patches/user_status/1-compatibility-26.json b/packages/nextcloud/lib/src/patches/user_status/0-compatibility-26.json similarity index 100% rename from packages/nextcloud/lib/src/patches/user_status/1-compatibility-26.json rename to packages/nextcloud/lib/src/patches/user_status/0-compatibility-26.json diff --git a/packages/nextcloud/lib/src/patches/user_status/0-oneof-workaround.json b/packages/nextcloud/lib/src/patches/user_status/0-oneof-workaround.json deleted file mode 100644 index 6f5533da1f9..00000000000 --- a/packages/nextcloud/lib/src/patches/user_status/0-oneof-workaround.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "op": "move", - "from": "/paths/~1ocs~1v2.php~1apps~1user_status~1api~1v1~1user_status~1revert~1{messageId}/delete/responses/200/content/application~1json/schema/properties/ocs/properties/data/oneOf", - "path": "/paths/~1ocs~1v2.php~1apps~1user_status~1api~1v1~1user_status~1revert~1{messageId}/delete/responses/200/content/application~1json/schema/properties/ocs/properties/data/anyOf" - } -]