From 61a28354f4ec437c88cbf6c9d8c6a5b276d7028a Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Wed, 27 Nov 2024 08:14:46 +0100 Subject: [PATCH] Update readme and underlying generator version --- Makefile | 2 +- README.md | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ab2e479..1584d85 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ OutputDir ?= tmp define openapi-generator docker run --rm -v "${PWD}:/local" -w "/local" \ - openapitools/openapi-generator-cli:v7.9.0 + openapitools/openapi-generator-cli:v7.10.0 endef all: compile diff --git a/README.md b/README.md index a1e6d24..2b9e757 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,19 @@ The generated server code for AMOC REST API and then, execute in the erlang shell: ```erlang - ServerParams = #{ip => {0, 0, 0, 0}, port => 4000, net_opts => []}. - amoc_rest_server:start(http_server, ServerParams). + ModuleHandler = openapi_callbacks, %% Module implementing the callbacks behaviour + TransportOpts = #{socket_opts => [{ip, {0, 0, 0, 0}}, {port, Port}]}, + ProtocolOpts = #{metrics_callback => fun prometheus_cowboy2_instrumenter:observe/1, + stream_handlers => [cowboy_metrics_h]}, + amoc_rest_server:start( + openapi_http_server, + #{ + transport => tcp, + transport_opts => TransportOpts, + protocol_opts => ProtocolOpts, + logic_handler => ModuleHandler + } + ). ``` ## swagger-ui integration