Comments (3)
Thanks for the interest! I think right now, I'd prefer to avoid adding the dependency (especially as it'll pull a number of dependencies) and since the work off the back of #1142 I'd love to keep us as lean as possible.
What sort of template functions are you looking for?
It is possible to modify the existing template functions to add the helpers we need?
Or to call oapi-codegen
as a library (but needs better documenting in #1487) ?
from oapi-codegen.
The most common funcs I've pulled in are dig
, haskey
, list
,and get
functions. Specifically I use those to work with the extensions that I have added to my openapi yaml. (fail
is useful for validation reasons as well, tho much less necessary as compared to the other 4.)
If I were to generalize, I think the datastructure funcs are the ones that would provide the most given the purpose of oapi-codegen. Most of them are implementable without imports, tho the merge ones are debatable.
from oapi-codegen.
Ive gone through the list of functions that may be useful from sprig for dict/list manipulation.
list
,append
,prepend
,first
,rest
,last
,initial
,reverse
,uniq
,without
,has
,slice
,concat
,chunk
dict
,get
,set
,unset
,hasKey
,pluck
,keys
,values
,pick
,omit
,dig
Most of the Must
variants etc. are not that useful in this lib I think, so those can be excluded. I also excluded the merge funcs as those pulled in an external library, and I dont think people are going to require merging maps.
I have not gone through and looked at the string manipulation functions yet, but I can almost guarantee some of those would be useful. Still, Id rather start out "small" if its believed worth it to any of these at all.
from oapi-codegen.
Related Issues (20)
- docs(contributing): when will we add new linting rules?
- docs(contributing): document when JSON schema changes needed
- docs: missing description for `compatibility` in JSON Schema
- feat: add an `engine` or `openapi-library` configuration item
- feat: provide a complex `overrides` configuration HOT 1
- feat: unique (+ more verbose) generated names
- feat(JSON Schema): improve validation to indicate that `strict-server` is required with a server
- Is there a way to customize the json tag names? HOT 4
- docs(examples): petstore readme is wrong
- Order of the properties in generated models are coming in sorted way.. Couldn't able to retain the original order given in Spec. HOT 3
- x-order not retaining the order mentioned in spec HOT 3
- x-order not respected when using $ref HOT 1
- autogenerated code for Echo server throws errors with golang 1.21+ versions HOT 1
- Remove common path from generated function names
- Enum constants not prefixed with type name
- chore(tests): add better coverage of `mergeOpenapiSchemas`
- Make possible use values other than strings as discriminator
- requestBody with oneOf does not generate marshal/unmarshal union data
- Bug: Header parameter parsing with fiber generator
- Generating Struct with Embedded Imported Type
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 oapi-codegen.