Git Product home page Git Product logo

Comments (5)

simskij avatar simskij commented on September 24, 2024 1

I'm thinking we'd use the datamodel-code-generator, probably as part of the CI of the relation interfaces repo itself, and that users then would be able to download the pydantic model straight from github and use it in their projects.

from traefik-k8s-operator.

jnsgruk avatar jnsgruk commented on September 24, 2024

I don't disagree here, but we should be cautious merging, as it will essentially be a breaking change due to changing the external requirements of the lib :) I'm interested to see the diff in the code though.

from traefik-k8s-operator.

simskij avatar simskij commented on September 24, 2024

I don't disagree here, but we should be cautious merging, as it will essentially be a breaking change due to changing the external requirements of the lib :) I'm interested to see the diff in the code though.

Agreed. Given that @PietroPasotti is working on v1 of the libs (#63), which essentially will be incompatible regardless, it feels like it could be a good time to do both these changes at the same time to not have break the compatibility twice. :)

from traefik-k8s-operator.

PietroPasotti avatar PietroPasotti commented on September 24, 2024

I like the idea! I was thinking to combine this with #38
And also in reference to canonical/charm-relation-interfaces#7 I'm thinking this would definitely settle the yaml/json score (pydantic has builtin json converters I believe) So dumping data is as easy as model.json().

I'm thinking about the last line you added; what do you reckon would the user story look like?

  • I want to implement an ingress Requirer.
  • I go to charm-relation-interfaces, grab the jsonschema spec
  • run the spec through our lib-provided tool jsonschema_to_pydantic /path/to/jsonschema/file.json, copy the result into the new requirer file.
  • Profit?

from traefik-k8s-operator.

PietroPasotti avatar PietroPasotti commented on September 24, 2024

@jnsgruk @simskij see #66

from traefik-k8s-operator.

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.