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

Can't select application/yaml as content type #306

Open
micahlmartin opened this issue Apr 12, 2023 · 2 comments
Open

Can't select application/yaml as content type #306

micahlmartin opened this issue Apr 12, 2023 · 2 comments

Comments

@micahlmartin
Copy link
Collaborator

micahlmartin commented Apr 12, 2023

In order to pass in a yaml pipeline content this has to have a content-type: application/yaml header. There's no way to actually select it in the autogenerated code.

localVarHttpContentTypes := []string{"application/json", "application/yaml"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}

func selectHeaderContentType(contentTypes []string) string {
if len(contentTypes) == 0 {
return ""
}
if contains(contentTypes, "application/json") {
return "application/json"
}
return contentTypes[0] // use the first content type specified in 'consumes'
}

@Geethree
Copy link

Geethree commented Jun 2, 2023

Oh yeah this is concerning.. as arguably the entire point of harness is pipelines =P

It looks like the terraform provider utilizes another older openapi client
https://github.com/harness/terraform-provider-harness/blob/fda158302d2e42e963aa059dcaabf0c28e1de17e/internal/service/platform/pipeline/resource_pipeline.go#LL147C37-L147C57

@wyattmunson Any chance you can poke this on yourside?

@Geethree
Copy link

Geethree commented Jun 2, 2023

Oh hmm... it looks like the nextgen Pipeline api is deprecated..
https://apidocs.harness.io/tag/Pipeline

image

The new pipelines api can take json, but this sdk does not support that 🤔

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

No branches or pull requests

2 participants