Skip to content

Issue 1075: Configure request headers#1

Draft
jessicasomaiya wants to merge 2 commits intoresolutionlife:mainfrom
jessicasomaiya:issue-1075/configure-request-headers
Draft

Issue 1075: Configure request headers#1
jessicasomaiya wants to merge 2 commits intoresolutionlife:mainfrom
jessicasomaiya:issue-1075/configure-request-headers

Conversation

@jessicasomaiya
Copy link
Copy Markdown

@jessicasomaiya jessicasomaiya commented Sep 21, 2022

TL;DR

This is a PR to address this comment looker-open-source#1075 (comment). This implementation doesn't actually fully implement the proposed solution because it's buggy and definitely not optimal. This PR is here just to share my attempt!

Description

The aim is to change the looker SDK generator for go to support an optional header arg headerOptions for Looker endpoints that support multiple Accept headers. The idea was to inspect the swagger file and add the arg conditionally.

I'm using the field returnType.mediaType, but if more than one media type/mime type is supported by looker this field returns empty. This isn't the only case where this field returns empty so there's either a bug in how the swagger mapping is done or there are some cases not covered in the swagger file. Due to this, the headerOptions arg is in places it shouldn't be such as ActivateAppUser.

Lastly, there are some linting changes in the PR but all the good stuff is in go.gen.ts.

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.

1 participant