Skip to content

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 requested a review from darrelmiller as a code owner December 30, 2020 14:51
@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.

3 participants