Comments (3)
We're currently storing extension values in YAML form in a field named "yaml".
from gnostic.
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:
- Extension owner provide a json schema for their extension to a generator code. Extensions plugin generators are invoked before invoking the openapic.
- 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.
- 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).
- 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.
- 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.
Generally resolved by #32.
from gnostic.
Related Issues (20)
- cmd/protoc-gen-openapi: additional_bindings duplicate operationId HOT 10
- When the field type is uint, it is invalid when setting the minimum to 0 HOT 1
- protoc-gen-openapi: POST method with empty body generates a required `requestBody` HOT 1
- protoc-gen-openapi output file name problem HOT 1
- Adding Error message to OpenAPI component schema HOT 4
- [protoc-gen-openapi] how can i generate required query parama? HOT 1
- panic: proto: file "openapiv2/OpenAPIv2.proto" has a name conflict over openapi.v2.Xml HOT 1
- botched .pb
- How do I define the proto file to generate custom fields in openai.yaml? HOT 2
- Is there any correlation between "protoc-gen-openapi" and "protoc-gen-openapiv2"? HOT 2
- [proto-gen-openapi] Fields marked as deprecated in the proto should be marked as deprecated in the openapi yaml
- Tag release with #359? HOT 2
- path parameters that refer to request message subfields are not mapped
- Request to remove reference to deprecated module 'github.com/golang/protobuf'
- [proto-gen-openapi] Wrong message included when message with same name exists in imported proto HOT 1
- go get upgrade broke compilation HOT 1
- Import of gnostic-models and gnostic generated code leads to panic HOT 8
- We are unable to detect the CVE-2022-28948 vulnerability through our vulnerability scanning.
- protoc-gen-openapi: Enum types that use stringified boolean values like `"TRUE"` are treated as the real boolean values HOT 2
- Openapiv3 doesn't able to generate of type map<string, bool> in protobuf
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gnostic.