Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(dynamite_end_to_end_test): test problematic ofs #1100

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions packages/dynamite/dynamite_end_to_end_test/lib/all_of.openapi.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// 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 'package:built_value/built_value.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';

part 'all_of.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 ObjectAllOf_0Interface {
@BuiltValueField(wireName: 'attribute1-allOf')
String get attribute1AllOf;
}

@BuiltValue(instantiable: false)
abstract interface class ObjectAllOf_1Interface {
@BuiltValueField(wireName: 'attribute2-allOf')
String get attribute2AllOf;
}

@BuiltValue(instantiable: false)
abstract interface class ObjectAllOfInterface implements ObjectAllOf_0Interface, ObjectAllOf_1Interface {}

abstract class ObjectAllOf implements ObjectAllOfInterface, Built<ObjectAllOf, ObjectAllOfBuilder> {
factory ObjectAllOf([final void Function(ObjectAllOfBuilder)? b]) = _$ObjectAllOf;

const ObjectAllOf._();

factory ObjectAllOf.fromJson(final Map<String, dynamic> json) => _jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

static Serializer<ObjectAllOf> get serializer => _$objectAllOfSerializer;
}

// coverage:ignore-start
final Serializers _serializers = (Serializers().toBuilder()
..addBuilderFactory(const FullType(ObjectAllOf), ObjectAllOf.new)
..add(ObjectAllOf.serializer))
.build();

final Serializers _jsonSerializers = (_serializers.toBuilder()
..add(DynamiteDoubleSerializer())
..addPlugin(StandardJsonPlugin())
..addPlugin(const ContentStringPlugin()))
.build();
// coverage:ignore-end
170 changes: 170 additions & 0 deletions packages/dynamite/dynamite_end_to_end_test/lib/all_of.openapi.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions packages/dynamite/dynamite_end_to_end_test/lib/all_of.openapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"openapi": "3.1.0",
"info": {
"title": "all of test",
"version": "0.0.1"
},
"components": {
"schemas": {
"ObjectAllOf": {
"description": "All of with objects only.",
"allOf": [
{
"type": "object",
"required": [
"attribute1-allOf"
],
"properties": {
"attribute1-allOf": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"attribute2-allOf"
],
"properties": {
"attribute2-allOf": {
"type": "string"
}
}
}
]
}
}
},
"paths": {},
"tags": []
}
Loading