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

Issue 1075: Configure request headers #1

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jessicasomaiya
Copy link

@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
1 participant