Giter Site home page Giter Site logo

Comments (3)

timburks avatar timburks commented on May 16, 2024

We're currently storing extension values in YAML form in a field named "yaml".

from gnostic.

guptasu avatar guptasu commented on May 16, 2024

One possible approach can be this:

May be having a plugin model, all of the code for which is auto generated from the json schema of the extension. These plugins are invoked from the openapic as it encounters 'x-' extensions.

User workflow will be:

  1. Extension owner provide a json schema for their extension to a generator code. Extensions plugin generators are invoked before invoking the openapic.
  2. Using this json schema, the generator code will create a proto and compiler that can construct this proto from a json object. Similar to the code we have to OpenAPIV2 generator.
  3. This extension compiler is responsible for taking in a YAML string and writing out a ByteString (all of this can be autogenerated via the generator and user just has to provide the json schema).
  4. openapic code will have some sort of registration to know extension plugin to invoke for various extensions that it will encounter as it runs (or openapic might not care and invoke all extension plugins in a sequence and break if the input gets handled by any extension plugin). openapic will invoke the extension plugins (very similar to plugins you already have) ) and then stick the returned ByteString in the generated openAPI proto object as a google.protofuf.Any type.
  5. The consumer of openAPI proto will detect the extensions they are interested in and will have to parse the Any type's ByteString back into the proto object that was created from the extensions json schema by the generator.

Hope that make sense.

from gnostic.

timburks avatar timburks commented on May 16, 2024

Generally resolved by #32.

from gnostic.

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.