Skip to content

[BUG] InstallationID is typed incorrectly #162

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

Closed
whi-tw opened this issue Jun 19, 2019 · 4 comments · Fixed by #164
Closed

[BUG] InstallationID is typed incorrectly #162

whi-tw opened this issue Jun 19, 2019 · 4 comments · Fixed by #164

Comments

@whi-tw
Copy link

whi-tw commented Jun 19, 2019

Hi,

It appears that InstallationID is typed incorrectly - it's specified as a string, but the API actually returns an integer, leading to unmarshal errors, as seen in the Terraform provider when importing an existing instance:

Error: netlify_site.* (import id: *): 1 error occurred:
        * import netlify_site.* result: &: netlify_site.*: json: cannot unmarshal number into Go struct field RepoInfo.installation_id of type string

The offending line is:

InstallationID string `json:"installation_id,omitempty"`

And in swagger:

open-api/swagger.yml

Lines 1737 to 1738 in 9abe15a

installation_id:
type: string

Thanks,

Tom

@whi-tw whi-tw changed the title InstallationID is typed incorrectly [BUG] InstallationID is typed incorrectly Jun 19, 2019
@sgrove
Copy link
Contributor

sgrove commented Jul 2, 2019

I also just hit this and came to report the same issue!

sgrove added a commit to sgrove/open-api that referenced this issue Jul 2, 2019
Was marked as `string`, but api returns `integer`

Closes netlify#162
@philippeckel
Copy link

Hi,

any chance this will be merged soon? I face the same issue. Thanks!

@philippeckel
Copy link

Sorry, but the problem still exists. This is the debug output from Terraform trying to import the Netlify site:

2019/08/07 19:45:32 [DEBUG] ReferenceTransformer: "netlify_site.main" references: []
2019/08/07 19:45:32 [TRACE] Completed graph transform *terraform.ReferenceTransformer (no changes)
netlify_site.main: Refreshing state... [id=XXXXXX]
2019/08/07 19:45:32 [ERROR] : eval: *terraform.EvalRefresh, err: json: cannot unmarshal number into Go struct field RepoInfo.installation_id of type string
2019/08/07 19:45:32 [ERROR] : eval: *terraform.EvalSequence, err: json: cannot unmarshal number into Go struct field RepoInfo.installation_id of type string
2019/08/07 19:45:32 [TRACE] [walkRefresh] Exiting eval tree: netlify_site.main
2019/08/07 19:45:32 [TRACE] vertex "netlify_site.main": visit complete

Error: json: cannot unmarshal number into Go struct field RepoInfo.installation_id of type string

I see the PR and the updated Swagger API documentation, but it still does not work. Any ideas how to solve this?

Thanks,
Philipp

@Mongey
Copy link

Mongey commented Aug 13, 2019

@peckeltw #170 should fix this

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 a pull request may close this issue.

4 participants