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

fix: ApolloSchemaDownloadConfiguration HTTP headers json #2811

Merged
merged 4 commits into from
Feb 8, 2023

Conversation

calvincestari
Copy link
Member

@calvincestari calvincestari commented Feb 6, 2023

Fixes #2661

This PR enables the HTTP headers, "headers" property within the "ApolloSchemaDownloadConfiguration" section of the JSON configuration file, to be written and parsed in a more intuitive format.

An example of the current format is [{ "key": "Authorization", "value": "<token>"}] where the new format would allow { "Authorization": "<token>"}.

  • The logic allows parsing of both formats.
  • The property type has not changed because that would be a breaking change and I didn't want to do that in a patch release. The config file format needs to be refactored at some point, this property change can happen then.
  • The encoding format has not changed either because there might be projects that build the configuration in code, serialize it to JSON and use it in outside tooling which would break if the encoding format changed now too. Adding the ability to simply parse the new format is the least intrusive change here.
  • PR Update documentation sample with new format #2812 is layered on top of this that updates the documentation to promote use of the new format.

@netlify
Copy link

netlify bot commented Feb 6, 2023

Deploy Preview for apollo-ios-docs canceled.

Name Link
🔨 Latest commit 627690b
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docs/deploys/63e13523b371810008184112

@calvincestari calvincestari mentioned this pull request Feb 8, 2023
7 tasks
Copy link
Contributor

@AnthonyMDev AnthonyMDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful :)

@calvincestari calvincestari merged commit f44d5b8 into main Feb 8, 2023
@calvincestari calvincestari deleted the fix/schemadownloadconfig-headers-json branch February 8, 2023 23:38
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.

No value associated with key CodingKeys when passing authorization in headers in codegen-config file
2 participants