Skip to content

Commit 139e9e4

Browse files
authored
Minor improvements to go-echo server (#9303)
* minor improvements to go-echo server * update go tech comm
1 parent b4f1747 commit 139e9e4

File tree

5 files changed

+90
-3
lines changed

5 files changed

+90
-3
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
7878
| | Languages/Frameworks |
7979
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8080
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0. Libraries: RestSharp, HttpClient), **C++** (cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) |
81-
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) |
81+
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) |
8282
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
8383
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
8484
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer** |
@@ -932,6 +932,7 @@ Here is a list of template creators:
932932
* Erlang Server: @galaxie
933933
* F# (Giraffe) Server: @nmfisher
934934
* Go Server: @guohuang
935+
* Go (Echo) Server: @ph4r5h4d
935936
* Go (Gin) Server: @kemokemo
936937
* GraphQL Express Server: @renepardon
937938
* Haskell Servant: @algas
@@ -1024,7 +1025,7 @@ If you want to join the committee, please kindly apply by sending an email to te
10241025
| Elm | @eriktim (2018/09) |
10251026
| Erlang | @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) |
10261027
| F# | @nmfisher (2019/05) |
1027-
| Go | @antihax (2017/11) @grokify (2018/07) @kemokemo (2018/09) @jirikuncar (2021/01) |
1028+
| Go | @antihax (2017/11) @grokify (2018/07) @kemokemo (2018/09) @jirikuncar (2021/01) @ph4r5h4d (2021/04) |
10281029
| GraphQL | @renepardon (2018/12) |
10291030
| Groovy | |
10301031
| Haskell | |

docs/generators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The following generators are available:
8686
* [erlang-server](generators/erlang-server.md)
8787
* [fsharp-functions (beta)](generators/fsharp-functions.md)
8888
* [fsharp-giraffe-server (beta)](generators/fsharp-giraffe-server.md)
89-
* [go-echo-server](generators/go-echo-server.md)
89+
* [go-echo-server (beta)](generators/go-echo-server.md)
9090
* [go-gin-server](generators/go-gin-server.md)
9191
* [go-server](generators/go-server.md)
9292
* [graphql-nodejs-express-server](generators/graphql-nodejs-express-server.md)

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoEchoServerCodegen.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.openapitools.codegen.languages;
218

319
import org.openapitools.codegen.*;
@@ -6,6 +22,8 @@
622
import java.util.*;
723

824
import org.openapitools.codegen.meta.features.*;
25+
import org.openapitools.codegen.meta.GeneratorMetadata;
26+
import org.openapitools.codegen.meta.Stability;
927
import org.slf4j.Logger;
1028
import org.slf4j.LoggerFactory;
1129

@@ -36,6 +54,10 @@ public String getHelp() {
3654
public GoEchoServerCodegen() {
3755
super();
3856

57+
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
58+
.stability(Stability.BETA)
59+
.build();
60+
3961
modifyFeatureSet(features -> features
4062
.includeDocumentationFeatures(DocumentationFeature.Readme)
4163
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML))

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,7 @@
13521352
<module>samples/client/petstore/javascript-promise-es6</module>
13531353
<module>samples/server/petstore/go-api-server</module>
13541354
<module>samples/server/petstore/go-gin-api-server</module>
1355+
<module>samples/server/petstore/go-echo-server</module>
13551356
</modules>
13561357
</profile>
13571358
<!-- test with JDK9 in Shippable CI -->
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<project>
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>org.openapitools</groupId>
4+
<artifactId>GoEchoServer</artifactId>
5+
<packaging>pom</packaging>
6+
<version>1.0-SNAPSHOT</version>
7+
<name>Go Gin Server</name>
8+
<build>
9+
<plugins>
10+
<plugin>
11+
<artifactId>maven-dependency-plugin</artifactId>
12+
<executions>
13+
<execution>
14+
<phase>package</phase>
15+
<goals>
16+
<goal>copy-dependencies</goal>
17+
</goals>
18+
<configuration>
19+
<outputDirectory>${project.build.directory}</outputDirectory>
20+
</configuration>
21+
</execution>
22+
</executions>
23+
</plugin>
24+
<plugin>
25+
<groupId>org.codehaus.mojo</groupId>
26+
<artifactId>exec-maven-plugin</artifactId>
27+
<version>1.2.1</version>
28+
<executions>
29+
<execution>
30+
<id>go-get</id>
31+
<phase>integration-test</phase>
32+
<goals>
33+
<goal>exec</goal>
34+
</goals>
35+
<configuration>
36+
<executable>go</executable>
37+
<arguments>
38+
<argument>go</argument>
39+
<argument>mod</argument>
40+
<argument>download</argument>
41+
</arguments>
42+
</configuration>
43+
</execution>
44+
<execution>
45+
<id>go-test</id>
46+
<phase>integration-test</phase>
47+
<goals>
48+
<goal>exec</goal>
49+
</goals>
50+
<configuration>
51+
<executable>go</executable>
52+
<arguments>
53+
<argument>build</argument>
54+
<argument>-o</argument>
55+
<argument>app</argument>
56+
</arguments>
57+
</configuration>
58+
</execution>
59+
</executions>
60+
</plugin>
61+
</plugins>
62+
</build>
63+
</project>

0 commit comments

Comments
 (0)