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

Support for string:binary. + more. #11

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Conversation

PROGrand
Copy link

@PROGrand PROGrand commented Mar 3, 2023

Description

  • support for string:binary in builder (Uint8List parser and json converter).
  • exposing ShelfRequest.request for using in handler implementations. Especially for shelf.Request.context interchanging between middlewares and handlers. For providing auth credentials from auth middleware to handlers for example.
  • support for latest code_builder (declareFinal patch).

PROGrand and others added 10 commits March 3, 2023 20:47
+ formatting
…ovider:

```dart
abstract class ApiEndpointWithRequest {
  OpenApiRequest? request;
}

class TestApiImpl extends TestApi implements ApiEndpointWithRequest {
  @OverRide
  OpenApiRequest? request;
  ShelfRequest get shelfRequest => request! as ShelfRequest;
  //...
}

/// Endpoint provider with Request.
class OpenapiEndpointProvider<ENDPOINT extends TestApiImpl>
    extends ApiEndpointProvider<ENDPOINT> {
  /// Constructor
  OpenapiEndpointProvider(this.implementation);

  /// Implementation
  final ENDPOINT implementation;

  @OverRide
  Future<RET> invoke<RET>(
    OpenApiRequest request,
    ApiEndpointCallback<ENDPOINT, RET> callback,
  ) async {
    implementation.request = request;
    return await callback(implementation);
  }
}

```
+ formatting
+ formatting
+ assignFinal -> declareFinal
@hpoul
Copy link
Owner

hpoul commented Apr 15, 2023

somehow this PR has quite a few formatting changes.. are you using dartfmt/flutter format?

@PROGrand
Copy link
Author

ok. Now it is formatted using 'dart format'. (flutter )

$ dart --version
Dart SDK version: 2.19.6 (stable) (Tue Mar 28 13:41:04 2023 +0000) on "windows_x64"
$ dart format .
Formatted packages\openapi_base\lib\src\openapi_base.dart
Formatted packages\openapi_base\lib\src\openapi_exception.dart
Formatted packages\openapi_base\lib\src\server\openapi_shelf_server.dart
Formatted packages\openapi_code_builder\example\bin\example_server.dart
Formatted packages\openapi_code_builder\lib\openapi_code_builder.dart
Formatted packages\openapi_code_builder\lib\src\openapi_code_builder.dart
Formatted 26 files (6 changed) in 0.58 seconds.

PROGrand and others added 6 commits June 9, 2023 12:24
# Conflicts:
#	packages/openapi_base/CHANGELOG.md
#	packages/openapi_base/pubspec.lock
#	packages/openapi_base/pubspec.yaml
#	packages/openapi_code_builder/example/pubspec.lock
#	packages/openapi_code_builder/pubspec.lock
#	packages/openapi_generator_flutter/pubspec.lock
#	packages/openapi_generator_flutter/pubspec.yaml
# Conflicts:
#	packages/openapi_base/CHANGELOG.md
#	packages/openapi_base/lib/src/util/uuid.dart
#	packages/openapi_base/pubspec.yaml
#	packages/openapi_code_builder/CHANGELOG.md
#	packages/openapi_code_builder/example/pubspec.lock
#	packages/openapi_code_builder/example/pubspec.yaml
#	packages/openapi_code_builder/pubspec.yaml
@hpoul
Copy link
Owner

hpoul commented Feb 3, 2024

Would it. be possible to split the PR up into just adding binary support?
Also is there some documentation in the specification for format: binary? I couldn't find anything.. the closest i came was to:

            type: string
            contentMediaType: image/png
            contentEncoding: base64

which doesn't use format at all 🤔

thanks

@PROGrand
Copy link
Author

PROGrand commented Feb 3, 2024

Hello, thank you for attention.

I unforced dependencies right now, so there are almost no dependency_overrides requirements with stable flutter. So it is most likely looks as your main branch with addition of:

  • binary support
  • upgraded deps
  • some cleaning (no pubspec.lock, removed comments)
  • gui app link supporting --http-base
  • added build_verify

Passes tests and runs without any problems. I have no plans to split PR, just because I completely satisfied with it.

string: binary is in opeanapi 3.0:
https://swagger.io/docs/specification/data-models/data-types/#string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants