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

Null check operator used on a null value #190

Closed
shigomany opened this issue Jul 20, 2021 · 5 comments · Fixed by #185
Closed

Null check operator used on a null value #190

shigomany opened this issue Jul 20, 2021 · 5 comments · Fixed by #185

Comments

@shigomany
Copy link

Hello, when generating the code, the following error appears:

[SEVERE] swagger_dart_code_generator:swagger_dart_code_generator on swagger/api-docs.swagger:

Null check operator used on a null value

my build.yaml:

targets:
  $default:
    sources:
      - lib/**
      - swaggers/**
      - swagger/**
      - $package$
    builders:
      swagger_dart_code_generator:
        options:
          input_folder: 'swagger/'
          output_folder: 'generated/'
          with_base_url: true
          with_converter: true
          use_required_attribute_for_headers: true
          ignore_headers: false
          use_default_null_for_lists: false
          use_inheritance: false
          build_only_models: false
          include_if_null:
            enabled: true
            value: false

packages:

json_annotation: ^4.0.1
build_runner: ^2.0.6
chopper_generator: ^4.0.1
json_serializable: ^4.1.3
swagger_dart_code_generator: ^2.0.7
chopper: ^4.0.1
@Vovanella95
Copy link
Collaborator

Hi @ltropin ,

Can you please provide swagger file or part of it where you have an error?

@shigomany
Copy link
Author

shigomany commented Jul 20, 2021

I do not know which part of the file is causing the problem

File

@Vovanella95

@Vovanella95
Copy link
Collaborator

I will check it today and fix it. Thanks for raising an issue!

@ltropin

@Vovanella95
Copy link
Collaborator

@ltropin thanks for provided file. You can remove it now if you want.

Problem was because request did not defined any type. I fixed it by generation Object for such cases.

Please check version 2.0.7+1 in pub.dev it's already published.

Please let us know in case of any other issues!

Feel free to close issue if everything OK

@shigomany
Copy link
Author

Thanks it worked

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 a pull request may close this issue.

2 participants