Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,15 @@ samples/client/petstore/erlang-proper/rebar.lock
samples/server/petstore/erlang-server/_build/
samples/server/petstore/erlang-server/rebar.lock

# dart
samples/client/petstore/dart/petstore/packages
samples/client/petstore/dart/flutter_petstore/test/packages
samples/client/petstore/dart/petstore/test/packages
**/.dart_tool
# Dart
**/dart*/**/.dart_tool
**/dart*/**/.packages
**/dart*/**/pubspec.lock
# Dart dio
**/dart*/**/*.g.dart
# Dart jaguar
**/dart*/**/*.jser.dart
**/dart*/**/*.jretro.dart

# JS
samples/client/petstore/javascript-es6/package-lock.json
Expand Down
6 changes: 6 additions & 0 deletions bin/configs/dart-dio-petstore-client-lib-fake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: dart-dio
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/dart-dio
additionalProperties:
hideGenerationTimestamp: "true"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
generatorName: dart-dio
outputDir: samples/client/petstore/dart-dio
outputDir: samples/client/petstore/dart-dio/petstore_client_lib
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/dart-dio
additionalProperties:
Expand Down
6 changes: 6 additions & 0 deletions bin/configs/dart-dio-petstore-client-lib.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: dart-dio
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/dart-dio
additionalProperties:
hideGenerationTimestamp: "true"
6 changes: 6 additions & 0 deletions bin/configs/dart-petstore-client-lib-fake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: dart
outputDir: samples/openapi3/client/petstore/dart2/petstore_client_lib_fake
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/dart2
additionalProperties:
hideGenerationTimestamp: "true"
6 changes: 6 additions & 0 deletions bin/configs/dart-petstore-client-lib.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: dart
outputDir: samples/openapi3/client/petstore/dart2/petstore_client_lib
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/dart2
additionalProperties:
hideGenerationTimestamp: "true"
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builde
{{#vars}}
{{#description}}/* {{{description}}} */{{/description}}
{{#isNullable}}
@nullable
@nullable
{{/isNullable}}
@BuiltValueField(wireName: r'{{baseName}}')
{{#isEnum}}{{classname}}{{{nameInCamelCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} get {{name}};
{{#allowableValues}}
{{#min}} // range from {{min}} to {{max}}{{/min}}//{{^min}}enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}
{{#min}}// range from {{min}} to {{max}}{{/min}}//{{^min}} enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}
{{/allowableValues}}
{{/vars}}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{#models}}
{{#model}}
{{#imports}}
import '{{.}}';
import '{{.}}';
{{/imports}}
{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}}
{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}}
{{/model}}
{{/models}}
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ class {{{classname}}} {
{{/items.isArray}}
{{/isMap}}
{{^isMap}}
{{#isBinary}}
{{{name}}}: null, // No support for decoding binary content from JSON
{{/isBinary}}
{{^isBinary}}
{{{name}}}: {{{complexType}}}.fromJson(json['{{{baseName}}}']),
{{/isBinary}}
{{/isMap}}
{{/isArray}}
{{/complexType}}
Expand Down
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,12 @@
<module>samples/client/petstore/javascript-promise-es6</module>
<module>samples/server/petstore/go-api-server</module>
<module>samples/server/petstore/go-gin-api-server</module>
<module>samples/client/petstore/dart2/petstore_client_lib</module>
<module>samples/client/petstore/dart2/petstore</module>
<module>samples/client/petstore/dart-dio</module>
<module>samples/openapi3/client/petstore/dart2/petstore_client_lib</module>
<module>samples/openapi3/client/petstore/dart2/petstore</module>
<module>samples/client/petstore/dart-dio/petstore_client_lib</module>
<module>samples/openapi3/client/petstore/dart-dio/petstore_client_lib</module>
<module>samples/client/petstore/dart-jaguar/openapi</module>
<module>samples/client/petstore/dart-jaguar/flutter_petstore/openapi</module>
</modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ doc/api/
# (Library packages only! Remove pattern if developing an application package)
pubspec.lock

# Don't commit *.g.dart files which are genrated during integration tests
lib/**/*.g.dart

# Don’t commit files and directories created by other development environments.
# For example, if your development environment creates any of the following files,
# consider putting them in a global ignore file:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.gitignore
README.md
analysis_options.yaml
doc/ApiResponse.md
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import 'package:built_value/built_value.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

part 'api_response.g.dart';

abstract class ApiResponse implements Built<ApiResponse, ApiResponseBuilder> {


@nullable
@nullable
@BuiltValueField(wireName: r'code')
int get code;

@nullable
@nullable
@BuiltValueField(wireName: r'type')
String get type;

@nullable
@nullable
@BuiltValueField(wireName: r'message')
String get message;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import 'package:built_value/built_value.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

part 'category.g.dart';

abstract class Category implements Built<Category, CategoryBuilder> {


@nullable
@nullable
@BuiltValueField(wireName: r'id')
int get id;

@nullable
@nullable
@BuiltValueField(wireName: r'name')
String get name;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
import 'package:built_collection/built_collection.dart';
import 'package:built_value/built_value.dart';
import 'package:built_collection/built_collection.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

part 'order.g.dart';

abstract class Order implements Built<Order, OrderBuilder> {


@nullable
@nullable
@BuiltValueField(wireName: r'id')
int get id;

@nullable
@nullable
@BuiltValueField(wireName: r'petId')
int get petId;

@nullable
@nullable
@BuiltValueField(wireName: r'quantity')
int get quantity;

@nullable
@nullable
@BuiltValueField(wireName: r'shipDate')
DateTime get shipDate;
/* Order Status */
@nullable
@nullable
@BuiltValueField(wireName: r'status')
OrderStatus get status;
//enum statusEnum { placed, approved, delivered, };
// enum statusEnum { placed, approved, delivered, };

@nullable
@nullable
@BuiltValueField(wireName: r'complete')
bool get complete;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
import 'package:openapi/model/tag.dart';
import 'package:built_collection/built_collection.dart';
import 'package:openapi/model/category.dart';
import 'package:built_value/built_value.dart';
import 'package:openapi/model/tag.dart';
import 'package:built_collection/built_collection.dart';
import 'package:openapi/model/category.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

part 'pet.g.dart';

abstract class Pet implements Built<Pet, PetBuilder> {


@nullable
@nullable
@BuiltValueField(wireName: r'id')
int get id;

@nullable
@nullable
@BuiltValueField(wireName: r'category')
Category get category;

@nullable
@nullable
@BuiltValueField(wireName: r'name')
String get name;

@nullable
@nullable
@BuiltValueField(wireName: r'photoUrls')
BuiltList<String> get photoUrls;

@nullable
@nullable
@BuiltValueField(wireName: r'tags')
BuiltList<Tag> get tags;
/* pet status in the store */
@nullable
@nullable
@BuiltValueField(wireName: r'status')
PetStatus get status;
//enum statusEnum { available, pending, sold, };
// enum statusEnum { available, pending, sold, };

// Boilerplate code needed to wire-up generated code
Pet._();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import 'package:built_value/built_value.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

part 'tag.g.dart';

abstract class Tag implements Built<Tag, TagBuilder> {


@nullable
@nullable
@BuiltValueField(wireName: r'id')
int get id;

@nullable
@nullable
@BuiltValueField(wireName: r'name')
String get name;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import 'package:built_value/built_value.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

part 'user.g.dart';

abstract class User implements Built<User, UserBuilder> {


@nullable
@nullable
@BuiltValueField(wireName: r'id')
int get id;

@nullable
@nullable
@BuiltValueField(wireName: r'username')
String get username;

@nullable
@nullable
@BuiltValueField(wireName: r'firstName')
String get firstName;

@nullable
@nullable
@BuiltValueField(wireName: r'lastName')
String get lastName;

@nullable
@nullable
@BuiltValueField(wireName: r'email')
String get email;

@nullable
@nullable
@BuiltValueField(wireName: r'password')
String get password;

@nullable
@nullable
@BuiltValueField(wireName: r'phone')
String get phone;
/* User Status */
@nullable
@nullable
@BuiltValueField(wireName: r'userStatus')
int get userStatus;

Expand Down
Loading