openapi_dart icon indicating copy to clipboard operation
openapi_dart copied to clipboard

Support for string:binary. + more.

Open PROGrand opened this issue 2 years ago • 4 comments

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 avatar Mar 03 '23 20:03 PROGrand

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

hpoul avatar Apr 15 '23 17:04 hpoul

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 avatar Apr 26 '23 07:04 PROGrand

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

hpoul avatar Feb 03 '24 09:02 hpoul

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

PROGrand avatar Feb 03 '24 15:02 PROGrand