Skip to content

Commit

Permalink
version 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-kuba committed Jan 6, 2023
1 parent 574cc99 commit db44f31
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 13 deletions.
3 changes: 1 addition & 2 deletions chat-client-java-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
<parent>
<groupId>cz.muni.chat</groupId>
<artifactId>chat-service-parent</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
</parent>

<!-- this module definition -->
<artifactId>chat-client-java-lib</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>Chat client library in Java</name>
<description>Client library generated using OpenAPI Generator</description>
Expand Down
3 changes: 1 addition & 2 deletions chat-client-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
<parent>
<groupId>cz.muni.chat</groupId>
<artifactId>chat-service-parent</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
</parent>

<!-- this module definition -->
<artifactId>chat-client-java</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>Executable chat client in Java</name>
<description>Command-line client for Chat service</description>
Expand Down
2 changes: 1 addition & 1 deletion chat-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>cz.muni.chat</groupId>
<artifactId>chat-service-parent</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
</parent>

<!-- this module definition -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @author Martin Kuba [email protected]
*/
@SpringBootApplication // this annotation marks this class as runnable Spring Boot app
@SpringBootApplication // this annotation marks this class as a runnable Spring Boot app
public class ChatApplication {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* Enum for background color.
* String values are different from enum identifiers, i.e. "#ffe4c4" for BISQUE.
*/
@Schema(
name = "BackgroundColorEnum",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
See [What is the maximum length of a URL in different browsers?](https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers)
"""
)
@SuppressWarnings("unused")
public class NewChatMessageRequest {

@NotBlank
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void onApplicationEvent(final ServletWebServerInitializedEvent event) {
* Adds shared definition to #/components/responses
* that cannot be added using annotations.
*/
@SuppressWarnings("Convert2Lambda")
@Bean
public OpenApiCustomizer openAPICustomizer() {
return new OpenApiCustomizer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,22 @@
// see javadoc at https://javadoc.io/doc/io.swagger.core.v3/swagger-annotations/latest/index.html
// see docs at https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Annotations
info = @Info(title = "Example Chat Service",
version = "1.0",
description = "Simple Spring Boot service for chatting",
version = "1.1",
description = """
Simple service for chatting. The API has operations for:
- getting all messages
- creating a new message
- getting messages in pages, i.e. last 20 messages or previous 20 messages
- getting a specific message by its id
The description of the API in OpenAPI format is generated by
the tool [SpringDoc v2](https://springdoc.org/v2/) from annotated Java classes,
mainly the controller class
[ChatRestController](https://github.com/martin-kuba/muni-chat-service/blob/main/chat-server/src/main/java/cz/muni/chat/server/rest/ChatRestController.java)
and the DTO classes in
[cz.muni.chat.server.facade](https://github.com/martin-kuba/muni-chat-service/tree/main/chat-server/src/main/java/cz/muni/chat/server/facade)
package.
""",
contact = @Contact(name = "Martin Kuba", email = "[email protected]", url = "https://www.muni.cz/lide/3988-martin-kuba"),
license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html")
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.util.comparator.Comparators;

import java.time.ZonedDateTime;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

import static org.apache.commons.text.StringEscapeUtils.escapeHtml4;

/**
* Simple Spring MVC Controller generating HTML page on URL /chat displaying all chat messages.
*/
@Controller
public class ChatUIController {

Expand Down
2 changes: 1 addition & 1 deletion chat-server/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h2>OpenAPI Description</h2>
<li>in JSON at <a target="_blank" href="/openapi">/openapi</a></li>
<li>in YAML at <a target="_blank" href="/openapi.yaml">/openapi.yaml</a></li>
</ul>
<p><a target="_blank" href="/swagger-ui.html">Open the OpenAPI description in Swagger UI</a> and try to call the service.</p>
<p>Open the OpenAPI description in <a target="_blank" href="/swagger-ui.html">Swagger UI</a> and try to call the service.</p>

</body>
</html>
17 changes: 15 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
openapi: 3.0.1
info:
title: Example Chat Service
description: Simple Spring Boot service for chatting
description: |
Simple service for chatting. The API has operations for:
- getting all messages
- creating a new message
- getting messages in pages, i.e. last 20 messages or previous 20 messages
- getting a specific message by its id
The description of the API in OpenAPI format is generated by
the tool [SpringDoc v2](https://springdoc.org/v2/) from annotated Java classes,
mainly the controller class
[ChatRestController](https://github.com/martin-kuba/muni-chat-service/blob/main/chat-server/src/main/java/cz/muni/chat/server/rest/ChatRestController.java)
and the DTO classes in
[cz.muni.chat.server.facade](https://github.com/martin-kuba/muni-chat-service/tree/main/chat-server/src/main/java/cz/muni/chat/server/facade)
package.
contact:
name: Martin Kuba
url: https://www.muni.cz/lide/3988-martin-kuba
email: [email protected]
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: "1.0"
version: "1.1"
servers:
- url: "{scheme}://{server}:{port}"
description: my server
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cz.muni.chat</groupId>
<artifactId>chat-service-parent</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
<packaging>pom</packaging>

<name>Chat service parent project</name>
Expand Down

0 comments on commit db44f31

Please sign in to comment.