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

better query parameters handling #7

Merged
merged 9 commits into from
Dec 30, 2020
Merged

Conversation

baywet
Copy link
Member

@baywet baywet commented Dec 30, 2020

Summary

This PR provides better query parameters handling for all languages:

  • Makes them optional
  • Adds overrides for optional parameters in Java
  • Better declaration in TypeScript to avoid needing a callback

Samples

Java

Existing

public java.util.concurrent.Future<Object> PostAsync(@javax.annotation.Nonnull final java.util.function.Consumer<PostQueryParameters> q) { return null; }

Additional

public java.util.concurrent.Future<Object> GetAsync() { return null; }

TypeScript

Before

public readonly GetAsync = (q: (options?: {select?: string[];
                    expand?: string[]}) => void) : Promise<object> => { return Promise.resolve({}); }

Now

public readonly GetAsync = (q?: {
                        select?: string[],
                        expand?: string[]
                        } | undefined) : Promise<object> => { return Promise.resolve({}); }

CSharp

Before

public Task<object> GetAsync(Action<GetParameters> q) { return null;}

Now

public Task<object> GetAsync(Action<GetParameters> q = default(Action<GetParameters)) { return null;}

Commits

  • adds a param for add code method
  • adds the ability to clone methods, parameters and types
  • adds support for nullable parameters in java
  • adds method override for java with no query parameter
  • adds a new line short hand for consistency
  • fixes query parameters declaration for typescript
  • makes query parameter optional and tags query parameters parameters
  • adds support for optional parameters in dotnet

@baywet baywet self-assigned this Dec 30, 2020
@baywet baywet merged commit d888ab9 into main Dec 30, 2020
@baywet baywet deleted the bugfix/typescript-query-params branch December 30, 2020 15:29
@baywet baywet added this to the MVP milestone Feb 16, 2021
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 this pull request may close these issues.

2 participants