All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- renamed swagger to openapi in error messages
- remove support to golang 1.19
- change jsonschema lib to use again
invopop/jsonschema
one, since now it support additionalProperties instead of patternProperties
- add new fields to Definition:
- Security
- Tags
- Summary
- Description
- Deprecated
- Extensions
- update kin-openapi to 0.114.0: this change removes components from exposed oas (if not manually set). In this update of kin-openapi, there is a breaking change with the T struct, which now accepts component as pointer.
- add
TransformPathToOasPath(path string) string
method to apirouter.Router interface to handle different types of paths parameters. If you use one of the supported routers, you should do nothing;
This is a big major release. The main achievement is to increase the usability of this library to all the routers. Below are listed the breaking changes you should care when update the version.
apirouter.NewGorillaMuxRouter
is nowgorilla.NewRouter
(exposed by packagegithub.com/davidebianchi/gswagger/support/gorilla
).- removed
apirouter.HandlerFunc
. Now it is exposed bygorilla.HandlerFunc
- changed
apirouter.Router
interface:- now it accept a generics
HandlerFunc
to define the handler function - add method
SwaggerHandler(contentType string, json []byte) HandlerFunc
- now it accept a generics
NewRouter
function now acceptHandlerFunc
as generics- drop support to golang <= 1.17
GenerateAndExposeSwagger
renamed toGenerateAndExposeOpenapi
- change jsonschema lib to
mia-platform/jsonschema v0.1.0
. This update removes thepatternProperties
withadditionalProperties
from all schemas - remove use of deprecated io/ioutil lib
- Tags support to
router.AddRoute
accepted definition
- upgrade deps
- path params are auto generated if not set
- change jsonschema lib to
invopop/jsonschema v0.5.0
. This updates remove theadditionalProperties: true
from all the schemas, as it is the default value
- modified Router interface by sorting addRoute arguments in a different manner: first method and then path To migrate, all the router implementation must be updated with the Router interface change.
Before:
type Router interface {
AddRoute(path, method string, handler HandlerFunc) Route
}
After:
type Router interface {
AddRoute(method, path string, handler HandlerFunc) Route
}
- [email protected]
- go-openapi/[email protected]
- labstack/echo/[email protected]
- handle router with path prefix
- add SubRouter method to use a new sub router
Introduced the apirouter.Router
interface, which abstract the used router.
Changed function are:
- Router struct now support
apirouter.Router
interface - NewRouter function accepted router is an
apirouter.Router
- AddRawRoute now accept
apirouter.Handler
iterface - AddRawRoute returns an interface instead of *mux.Router. This interface is the Route returned by specific Router
- AddRoute now accept
apirouter.Handler
iterface - AddRoute returns an interface instead of *mux.Router. This interface is the Route returned by specific Router
Initial release