Giter Site home page Giter Site logo

Comments (5)

Arnavion avatar Arnavion commented on June 21, 2024 1

As a workaround until then, you can take the http::Request<Vec<u8>> that you get from Ingress::patch_namespaced_ingress and replace its body with a body containing a serde_json::Value of your choice.

from k8s-openapi.

Arnavion avatar Arnavion commented on June 21, 2024 1

With 36334e6, Patch is now emitted as the enum I showed above, and all operations set the Content-Type header in the generated request.

from k8s-openapi.

Arnavion avatar Arnavion commented on June 21, 2024

This was fixed in 79185b3 It'll be in 0.5.0

from k8s-openapi.

JoshMock avatar JoshMock commented on June 21, 2024

Thank you @Arnavion! I'll give this a shot.

from k8s-openapi.

Arnavion avatar Arnavion commented on June 21, 2024

Note that you'll also need to set the Content-Type header to one of application/json-patch+json, application/merge-patch+json or application/strategic-merge-patch+json depending on what type of patch you're sending.


These are listed in the spec but I can't think of a way to easily surface this choice to the API user. Maybe something like

-struct Patch(serde_json::Value);
+enum Patch {
+    Json(serde_json::Value),
+    Merge(serde_json::Value),
+    StrategicMerge(serde_json::Value),
+}

and then have every API operation that takes a &Patch have special codegen.

It does look like patch operations are the only place where this kind of Content-Type choice matters, and it's always these three types, so it doesn't seem like a bad idea to have special codegen for it...

from k8s-openapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.