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

Query parameters with $ in them are not escaped #262

Open
JamesHancockAtteria opened this issue Sep 26, 2024 · 0 comments
Open

Query parameters with $ in them are not escaped #262

JamesHancockAtteria opened this issue Sep 26, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@JamesHancockAtteria
Copy link

Steps to reproduce

Use this:
openapi.json

This has $filter etc for odata functionality on it.

It causes errors in the generated code for @query('$filter') because it thinks it should be passing a variable.

Expected results

Should recognize the $filter etc. names and escape the $ ($)

Actual results

Doesn't escape so dart thinks it's a variable insertion into a string.

Your OpenApi snippet

See above.

Code sample

Code sample
  /// List Users.
  ///
  /// [filter] - Filter the results using OData syntax.
  ///
  /// [orderby] - Order the results using OData syntax.
  ///
  /// [top] - Limit the number of results.
  ///
  /// [skip] - Skip the specified number of results.
  ///
  /// [count] - Return the Total Count before pagination.
  @GET('/v1/Users/list')
  Future<IQueryResultIAsyncEnumerableOfPersonRefDto> list({
    @Query('$filter') String? object0,
    @Query('$orderby') String? object1,
    @Query('$top') int? object2,
    @Query('$skip') int? object3,
    @Query('$count') bool? object4,
  });

Logs

Logs
[Paste your logs here]

Dart version and used packages versions

Dart version
[Paste your output here]
Packages version
[Paste your output here]
@Carapacik Carapacik self-assigned this Sep 30, 2024
@Carapacik Carapacik added the bug Something isn't working label Sep 30, 2024
@Carapacik Carapacik reopened this Dec 5, 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
Projects
None yet
Development

No branches or pull requests

2 participants