palantir / conjure-typescript

Conjure generator for TypeScript clients
Apache License 2.0
17 stars 16 forks source link

GET query params are ordered according to the generated typescript #263

Open dfischercodethoughts opened 9 months ago

dfischercodethoughts commented 9 months ago

What happens?

If I have two endpoints defined in conjure:

getEndpoint:
  https: GET /endpoint/
  args:
    firstArg:
      type: TypeThatResolvesToString
      param-type: query
  returns: ReturnType

and

getEndpoint:
  https: GET /endpoint/
  args:
    secondArg:
      type: SecondTypeThatAlsoResolvesToString
      param-type: query
    firstArg:
      type: TypeThatResolvesToString
      param-type: query
  returns: ReturnType

This breaks the typescript generated by conjure, but isn't a wire break. The typescript breaks is because in the first conjure the first argument was a string for firstArg, but in the second it corresponds to a string for secondArg. Thus after upgrading to the second type script, any users of the typescript clients would continue to send the single firstArg string into what is now the secondArg field.

What should happen?

The typescript that is generated for GET query parameters should be order agnostic.