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

[BUG] $ in path results in wrong string for chopper generation #781

Open
matecode opened this issue Nov 6, 2024 · 0 comments
Open

[BUG] $ in path results in wrong string for chopper generation #781

matecode opened this issue Nov 6, 2024 · 0 comments
Assignees
Labels
bug Something isn't working Triage needed

Comments

@matecode
Copy link

matecode commented Nov 6, 2024

I have an API where I have several endpoints containing a .../$batch, which result in the following error:

Describe the bug
If the path contains a $, this is not escaped when *.swagger.dart is generated, resulting in an incorrect string.

To Reproduce

openapi: 3.0.0
info:
  version: 1.0.0
  title: Sample API
  description: A sample API to illustrate OpenAPI concepts
paths:
  /list/$batch:
    post:
      description: Returns a list of stuff
      responses:
        '200':
          description: Successful response

is genertated to (just a part of *.swagger.dart)

@ChopperApi()
abstract class TestApi extends ChopperService {
  ...
  ///
  @Get(path: '/list/$batch')
  Future<chopper.Response> _list$BatchGet();
}

Expected behavior
The String in the path in the ChopperService should be escaped:
@Get(path: '/list/\$batch')

Library version used:
swagger_dart_code_generator: 3.0.1

Thank you for your help

@matecode matecode added bug Something isn't working Triage needed labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Triage needed
Projects
None yet
Development

No branches or pull requests

3 participants