From 14aa419c61f203613f8e0007e46486d2670d6882 Mon Sep 17 00:00:00 2001 From: Gerard Snaauw <33763579+gerardsn@users.noreply.github.com> Date: Wed, 8 Jan 2025 11:48:09 +0100 Subject: [PATCH] cleanup: removed unused files and add readme on ssi_types_test (#3644) --- api/README.md | 4 +++ codegen/oapi/echo/echo-register.tmpl | 46 ---------------------------- 2 files changed, 4 insertions(+), 46 deletions(-) create mode 100644 api/README.md delete mode 100644 codegen/oapi/echo/echo-register.tmpl diff --git a/api/README.md b/api/README.md new file mode 100644 index 0000000000..e869415701 --- /dev/null +++ b/api/README.md @@ -0,0 +1,4 @@ +Several of the OpenAPI files refer to the same 'things' such as VCs, DIDs, DID Documents, etc. +To keep the schemas in sync over all OpenAPI files we have defined these shared schemas in `docs/_static/common/ssi_types.yaml`. + +The tests defined here serve to verify that the structs generated from these schemas match the structs we use internally. \ No newline at end of file diff --git a/codegen/oapi/echo/echo-register.tmpl b/codegen/oapi/echo/echo-register.tmpl deleted file mode 100644 index 0a7c08351a..0000000000 --- a/codegen/oapi/echo/echo-register.tmpl +++ /dev/null @@ -1,46 +0,0 @@ -// PATCH: This template file was taken from pkg/codegen/templates/echo/echo-register.tmpl - -// This is a simple interface which specifies echo.Route addition functions which -// are present on both echo.Echo and echo.Group, since we want to allow using -// either of them for path registration -type EchoRouter interface { - CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route - TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route -} - -type Preprocessor interface { - Preprocess(operationID string, context echo.Context) -} - -type ErrorStatusCodeResolver interface { - ResolveStatusCode(err error) int -} - -// RegisterHandlers adds each server route to the EchoRouter. -func RegisterHandlers(router EchoRouter, si ServerInterface) { - RegisterHandlersWithBaseURL(router, si, "") -} - -// Registers handlers, and prepends BaseURL to the paths, so that the paths -// can be served under a prefix. -func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { -{{if .}} - wrapper := ServerInterfaceWrapper{ - Handler: si, - } -{{end}} -// PATCH: This alteration wraps the call to the implementation in a function that sets the "OperationId" context parameter, -// so it can be used in error reporting middleware. -{{range .}}router.{{.Method}}(baseURL + "{{.Path | swaggerUriToEchoUri}}", func(context echo.Context) error { - si.(Preprocessor).Preprocess("{{.OperationId}}", context) - return wrapper.{{.OperationId}}(context) - }) -{{end}} -}