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

[dart][dio] add dateLibrary options ( core, timemachine ) #4716

Merged
merged 5 commits into from
Dec 16, 2019

Conversation

amondnet
Copy link
Contributor

@amondnet amondnet commented Dec 6, 2019

This pr adds dateLibrary option and simple test to dart-dio generator.
dateLibrary has two options.

If dateLibrary is timemachine,

input

openapi: 3.0.0
info:
  contact:
    email: amond@amond.net
  description: test
  title: test
  version: 1.0.0
paths:
  /test:
    get:
      responses:
        200:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DateContainer'
          description: OK

components:
    schemas:
      DateContainer:
        type: object
        properties:
          date:
            format: date
            type: string

output

import 'package:time_machine/time_machine.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';

part 'date_container.g.dart';

abstract class DateContainer
    implements Built<DateContainer, DateContainerBuilder> {
  @nullable
  @BuiltValueField(wireName: 'date')
  LocalDate get date;

  // Boilerplate code needed to wire-up generated code
  DateContainer._();

  factory DateContainer([updates(DateContainerBuilder b)]) = _$DateContainer;
  static Serializer<DateContainer> get serializer => _$dateContainerSerializer;
}

@ircecho @swipesight @jaumard @nickmeinhold

--

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

Signed-off-by: Minsu Lee <amond@amond.net>
Signed-off-by: Minsu Lee <amond@amond.net>
@wing328
Copy link
Member

wing328 commented Dec 12, 2019

Please run the following to update the doc as well

"./bin/utils/export_docs_generators.sh"
"./bin/utils/copy-to-website.sh"
"./bin/utils/export_generators_readme.sh

@amondnet
Copy link
Contributor Author

@wing328 I have updated the documentation.

@nickmeinhold
Copy link
Contributor

Thanks @amondnet!

So guys I don’t use this generator or know much about it.

Personally I think we should be working toward a single dart generator with options rather than continuing to diverge. I respect that others have different opinions but that is where I want to be spending my limited time rather than trying to stay on top of the different generators.

I’m wondering if, rather than getting silence from the technical committee, @wing328 what do you think about asking @athornz and @amondnet if they want to be the technical committee for the dart-dio generator (and would you guys want to?).

Thanks, sorry I'm not more help.

Copy link
Contributor

@josh-burton josh-burton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I think this is a nice addition to the generator

@josh-burton
Copy link
Contributor

@nickmeinhold I'm happy to be added to the committee for dart dio.

@amondnet
Copy link
Contributor Author

@nickcmaynard Yes, I would like to join the committee.

@wing328 wing328 added this to the 4.2.3 milestone Dec 16, 2019
@wing328 wing328 changed the title feat(dart-dio): add dateLibrary options ( core, timemachine ) [dart][dio] add dateLibrary options ( core, timemachine ) Dec 16, 2019
@wing328
Copy link
Member

wing328 commented Dec 16, 2019

Add @athornz, @amondnet to Dart technical committee via #4800 as both have at least 3 merged PRs for Dart generators.

Thanks for joining us to help move the project forward.

@wing328 wing328 merged commit c98644a into OpenAPITools:master Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants