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

Unsafe argument of type any on PlatformProviderResponse.data #1013

Open
reefdog opened this issue May 14, 2024 · 6 comments
Open

Unsafe argument of type any on PlatformProviderResponse.data #1013

reefdog opened this issue May 14, 2024 · 6 comments
Assignees

Comments

@reefdog
Copy link
Contributor

reefdog commented May 14, 2024

When using the PlatformProviderResponse type, accessing the data property nets ye olde complainte:

Unsafe argument of type any assigned to a parameter of type object.

Here's the line that actually calls the data property: https://github.com/PhilanthropyDataCommons/front-end/blob/3e39eb2f5815dd0de2caf03733d94242475465ef/src/components/DataPlatformProvider/DataPlatformProviderLoader.tsx#L190

Unsure if this should be part of #1004 or is separate.

@slifty
Copy link
Member

slifty commented May 16, 2024

Part of the issue here is that it basically is an any due to the nature of our partial implementation of platform provider data.

I think for this one you should just use a lint disable, and we know we'll be refactoring this functionality / properly implementing it down the line.

What do you think?

@slifty slifty self-assigned this May 16, 2024
@reefdog
Copy link
Contributor Author

reefdog commented May 17, 2024

Perfectly fine by me.

@reefdog reefdog closed this as completed May 17, 2024
@reefdog reefdog reopened this May 17, 2024
@reefdog
Copy link
Contributor Author

reefdog commented May 17, 2024

I should close this with the appropriate status!

reefdog added a commit to PhilanthropyDataCommons/front-end that referenced this issue May 17, 2024
In order to do this, we needed to disable the ESLint complaint about the
`data` property being an `any`. This is allowable because in this ersatz
implementation of a provider response, we don’t know the shape of the
data.[1]

Issue #737 Replace `PlatformProviderResponse` type with SDK version

[1] PhilanthropyDataCommons/service#1013 (comment)
@slifty slifty closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
@reefdog
Copy link
Contributor Author

reefdog commented May 18, 2024

@slifty 😮 how do you get credit for closing this as not planned? I thought I did that! Here, I'm gonna steal credit.

@reefdog reefdog reopened this May 18, 2024
@reefdog reefdog closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
@reefdog
Copy link
Contributor Author

reefdog commented May 18, 2024

Ohhh, I see now. I changed the drop-down to "Close as not planned" but didn't actually click the Close button. I didn't realize it was a two-step.

This was useful for more than just narcissism.

reefdog added a commit to PhilanthropyDataCommons/front-end that referenced this issue May 20, 2024
In order to do this, we needed to disable the ESLint complaint about the
`data` property being an `any`. This is allowable because in this ersatz
implementation of a provider response, we don’t know the shape of the
data.[1]

Issue #737 Replace `PlatformProviderResponse` type with SDK version

[1] PhilanthropyDataCommons/service#1013 (comment)
@reefdog
Copy link
Contributor Author

reefdog commented May 20, 2024

@slifty discovered that swagger-codegen incorrectly translates object to any, a problem subsequently fixed in the swagger-codegen fork openapi-generator.

Thus, we can actually reopen this issue and consider it blocked until either swagger-codegen is fixed or we move to openapi-generator for SDK generation.

@reefdog reefdog reopened this May 20, 2024
reefdog added a commit to PhilanthropyDataCommons/front-end that referenced this issue May 20, 2024
In order to do this, we needed to disable the ESLint complaint about the
`data` property being an `any`. Which itself is due to an upstream bug
in our current SDK generator[1]; once fixed, we can remove this disable.

Issue #737 Replace `PlatformProviderResponse` type with SDK version

[1] PhilanthropyDataCommons/service#1013 (comment)
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