Skip to content

Commit

Permalink
fix: support different query parameter encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi committed Oct 11, 2024
1 parent 309b233 commit 63e0035
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
17 changes: 16 additions & 1 deletion fern/apis/fdr/definition/api/latest/endpoint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ types:
defaultEnvironment: optional<rootCommons.EnvironmentId>
environments: optional<list<commons.Environment>>
pathParameters: optional<list<type.ObjectProperty>>
queryParameters: optional<list<type.ObjectProperty>>
queryParameters: optional<list<QueryParameter>>
requestHeaders: optional<list<type.ObjectProperty>>
responseHeaders: optional<list<type.ObjectProperty>> # this is not being used currently
request: optional<HttpRequest>
Expand All @@ -37,6 +37,21 @@ types:
examples: optional<list<ExampleEndpointCall>>
snippetTemplates: optional<EndpointSnippetTemplates>

QueryParameter:
union:
commaSeparated:
type: type.ObjectProperty
docs: An array of query parameters that are serialized as a comma delimited list
exploded:
type: type.ObjectProperty
docs: An array of query parameters that are sent as individual params in the URL
deepObject:
type: type.ObjectProperty
docs: A query parameter that is an object with properties and serialized as `a[key1]=value1`
basic:
type: type.ObjectProperty
docs: A basic primitive query parameter

EndpointSnippetTemplates:
properties:
typescript: optional<snippetTemplate.VersionedSnippetTemplate>
Expand Down
6 changes: 6 additions & 0 deletions fern/apis/fdr/definition/api/v1/read/endpoint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ types:
properties:
key: string
type: type.TypeReference
arrayEncoding: optional<QueryParameterArrayEncoding>

QueryParameterArrayEncoding:
enum:
- comma
- exploded

Header:
extends:
Expand Down
6 changes: 6 additions & 0 deletions fern/apis/fdr/definition/api/v1/register/endpoint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ types:
properties:
key: string
type: type.TypeReference
arrayEncoding: optional<QueryParameterArrayEncoding>

QueryParameterArrayEncoding:
enum:
- comma
- exploded

Header:
extends:
Expand Down

0 comments on commit 63e0035

Please sign in to comment.