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-next] Adds an option for using the dio_http package #10497

Merged
merged 4 commits into from Oct 5, 2021

Conversation

josh-burton
Copy link
Contributor

@josh-burton josh-burton commented Sep 29, 2021

Adds a new generator option to change the dio package.

Options are dio or dio_http.

Relates to #10305

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (5.3.0), 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@jaumard @josh-burton @amondnet @sbu-WBT @kuhnroyal @agilob @ahmednfwela

@josh-burton josh-burton changed the title [dart-dio] Adds an option for using the dio_http package [dart-dio-next] Adds an option for using the dio_http package Sep 29, 2021
@kuhnroyal
Copy link
Contributor

Can you create a sample config in bin/configs and add the sample to the samples.dart-2.13 in the pom.xml. Then we can run it automatically in CI.

@josh-burton
Copy link
Contributor Author

Can you create a sample config in bin/configs and add the sample to the samples.dart-2.13 in the pom.xml. Then we can run it automatically in CI.

@kuhnroyal I've added the sample config, a pom.xml and added that pom to the project pom.xml. I'm not sure how the _tests sample gets generated though (e.g. samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake_tests)

@kuhnroyal
Copy link
Contributor

Those are written by hand. Probably don't add those for now.

Copy link
Contributor

@kuhnroyal kuhnroyal left a comment

Choose a reason for hiding this comment

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

Nice!

@wing328 wing328 merged commit f5e8f54 into OpenAPITools:master Oct 5, 2021
@wing328 wing328 added this to the 5.3.0 milestone Oct 5, 2021
@lam-nv
Copy link

lam-nv commented Nov 7, 2021

Hi @josh-burton,

I have question related to dioImport, I'm creating a custom template for my project, based on dart-dio-next with small change, but when config the templateDir in config.yaml then I got the empty value like import ''; instead of import 'package:dio/dio.dart'
Screen Shot 2021-11-07 at 07 11 45

I have checked by removing the templateDir then I can see the expected result import 'package:dio/dio.dart'

config.yaml:

generatorName: dart-dio-next
outputDir: ../api_provider
inputSpec: openapi.json
templateDir: src/main/resources/dart/libraries/dio  # my problem is here
typeMappings:
  Client: "ModelClient"
  File: "ModelFile"
  EnumClass: "ModelEnumClass"
additionalProperties:
  hideGenerationTimestamp: "true"
  dioLibrary: dio
  clientName: api_provider
  pubVersion: 1.0.0
  pubName: api_provider
  pubLibrary: api_provider

And this is command I used to run the generator:

openapi-generator-cli generate --config \"./openapi_config.yaml\" --skip-validate-spec 

in node environment with package:

    "@openapitools/openapi-generator-cli": "^2.4.12",

Could you advice how to I correct it?

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.

None yet

6 participants