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

Typings do not match current interface #249

Closed
RobertDiebels opened this issue Apr 5, 2018 · 8 comments
Closed

Typings do not match current interface #249

RobertDiebels opened this issue Apr 5, 2018 · 8 comments

Comments

@RobertDiebels
Copy link

RobertDiebels commented Apr 5, 2018

The Typecript index.d.ts does not reflect the 5.2.0 interface.
KubernetesClient.Client is missing.

@silasbw
Copy link
Contributor

silasbw commented Apr 6, 2018

Yeah, we need to add this and it's high on the priority list. If someone wants to help out, the high-level approach would be:

  1. Add client classes for the existing swaggers specs in lib/specs. E.g., add a Client class to lib/client-1.7:
const SwaggerClient = require('./swagger-client');
module.export = class Client extends SwaggerClient {
  constructor() {
    super({ version: '1.7' });
  }
};
  1. Add a typings.js script similar to the docs one that generates typings for a specified swagger spec and the associated static clients defined in 1.
  2. Generate typings for the included swagger specs in lib/specs and commit them.

nagapavan pushed a commit to nagapavan/kubernetes-client that referenced this issue Apr 13, 2018
@jeffmaury
Copy link

I am trying to use the bindings from a VSCode extension for OpenShift but did not manage to find the solution. Is this related to this one as well ?

@silasbw
Copy link
Contributor

silasbw commented May 2, 2018

Yep -- do you have some time to help out :)?

@jeffmaury
Copy link

Yes no pb

@silasbw silasbw mentioned this issue May 8, 2018
@shcallaway
Copy link

Still an issue in 5.3.1.

@silasbw
Copy link
Contributor

silasbw commented Jul 12, 2018

I know, I'm sorry :(

I have a half-baked branch that generates the bindings. It's not quite ready, and I keep telling myself "I'll do it this weekend". I'll see what I can do. I'll at least try to dust it off and push it up in case someone else wants to contribute to it or take it over.

@RobertDiebels
Copy link
Author

RobertDiebels commented Jul 18, 2018

@silasbw I believe I read something about a typescript generator for the OpenAPISpec a while ago maybe that would be a direction investigate? Could possibly save you some time.

EDIT: I don't have the time to look at this issue further unfortunately.

@silasbw
Copy link
Contributor

silasbw commented Jul 18, 2018

It would, but it doesn't generate very "fluent" names for the API calls. The names basically end up being the Operation ID which are pretty unwieldy and don't map well to the kubernetes reference documentation. I discuss this more is https://godaddy.github.io/2018/04/10/an-intuitive-nodejs-client-for-the-kubernetes-api/.

Qualitatively I like the API naming conventions that kubernetes-client uses (e.g., client.api.namespaces('foo').pods('goo').get(), but it comes at the cost of writing our own generators.

silasbw pushed a commit that referenced this issue Aug 28, 2018
This is the first PR that begins to address #249
silasbw pushed a commit that referenced this issue Aug 28, 2018
This is the first PR that begins to address #249
silasbw added a commit that referenced this issue Aug 28, 2018
silasbw pushed a commit that referenced this issue Aug 28, 2018
BREAKING CHANGE: This replaces the 4.X declaration file.

Fixes #249
kdamedhaar added a commit to kdamedhaar/k8-client that referenced this issue Dec 17, 2020
kdamedhaar added a commit to kdamedhaar/k8-client that referenced this issue Dec 17, 2020
BREAKING CHANGE: This replaces the 4.X declaration file.

Fixes godaddy/kubernetes-client#249
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants