Skip to content

Commit

Permalink
adds markdown support
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Henke authored and timonback committed Jan 26, 2024
1 parent b08c66e commit 2e0b8a0
Show file tree
Hide file tree
Showing 18 changed files with 1,735 additions and 296 deletions.
11 changes: 10 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,16 @@
"contributions": [
"code"
]
}
},
{
"login": "robert-henke",
"name": "Robert Henke",
"avatar_url": "https://avatars.githubusercontent.com/u/157017289?v=4",
"profile": "https://github.com/robert-henke",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"linkToUsage": false
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ More details in the documentation.
- [LVM Versicherung](https://www.lvm.de/privatkunden/)
- [OTTO](https://www.otto.de)
- [Teambank](https://www.teambank.de)
- [aconium](https://www.aconium.eu)

Comment in [this PR](https://github.com/springwolf/springwolf-core/issues/342) to add your company and spread the word

Expand Down Expand Up @@ -185,6 +186,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jmwestbe"><img src="https://avatars.githubusercontent.com/u/26258285?v=4?s=100" width="100px;" alt="jmwestbe"/><br /><sub><b>jmwestbe</b></sub></a><br /><a href="https://github.com/stavshamir/Springwolf/commits?author=jmwestbe" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pdalfarr"><img src="https://avatars.githubusercontent.com/u/1537201?v=4?s=100" width="100px;" alt="pdalfarr"/><br /><sub><b>pdalfarr</b></sub></a><br /><a href="https://github.com/stavshamir/Springwolf/commits?author=pdalfarr" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/krzysztofxkwiecien"><img src="https://avatars.githubusercontent.com/u/37042650?v=4?s=100" width="100px;" alt="Krzysztof Kwiecień"/><br /><sub><b>Krzysztof Kwiecień</b></sub></a><br /><a href="https://github.com/stavshamir/Springwolf/commits?author=krzysztofxkwiecien" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/robert-henke"><img src="https://avatars.githubusercontent.com/u/157017289?v=4?s=100" width="100px;" alt="Robert Henke"/><br /><sub><b>Robert Henke</b></sub></a><br /><a href="https://github.com/robert-henke/Springwolf/commits?author=robert-henke" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,34 @@

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;

@Schema(description = "Example payload model")
@Schema(
description =
"""
Example payload model demonstrating markdown text styling:
**bold**, *cursive* and <u>underlined</u>
""")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ExamplePayloadDto {
@Schema(description = "Some string field", example = "some string value", requiredMode = REQUIRED)
@Schema(
description =
"""
### Some string field with Markdown
- **bold**
- *cursive*
- images: <img src="./assets/springwolf-logo.png" alt="Springwolf" height="50"/>
- and code blocks (json, http, java)
```json
{
"key1":"value1",
"key2":"value2"
}
```
""",
example = "some string value",
requiredMode = REQUIRED)
private String someString;

@Schema(description = "Some long field", example = "5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ springwolf.enabled=true
springwolf.docket.base-package=io.github.stavshamir.springwolf.example.kafka
springwolf.docket.info.title=${spring.application.name}
springwolf.docket.info.version=1.0.0
springwolf.docket.info.description=Springwolf example project to demonstrate springwolfs abilities
springwolf.docket.info.description=Springwolf example project to demonstrate springwolfs abilities, including **markdown** support for descriptions.
springwolf.docket.info.terms-of-service=http://asyncapi.org/terms
springwolf.docket.info.contact.name=springwolf
springwolf.docket.info.contact.email=example@example.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ void asyncApiResourceArtifactTest() throws IOException {

InputStream actualStream = this.getClass().getResourceAsStream("/openapi-generated.json");
String actual = IOUtils.toString(actualStream, StandardCharsets.UTF_8)
.replace("\\u003c", "<") // openapi generator replaces "<" with its unicode representation
.replace("\\u003d", "=") // openapi generator replaces equal (=) with its unicode representation
.replace("\\u003e", ">") // openapi generator replaces ">" with its unicode representation
.replace(
"localhost:9092",
"kafka:29092"); // When running with EmbeddedKafka, localhost is used as hostname
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "Springwolf example project - Kafka",
"version": "1.0.0",
"description": "Springwolf example project to demonstrate springwolfs abilities",
"description": "Springwolf example project to demonstrate springwolfs abilities, including **markdown** support for descriptions.",
"contact": {
"name": "springwolf",
"url": "https://github.com/springwolf/springwolf-core",
Expand Down Expand Up @@ -529,7 +529,7 @@
"name": "io.github.stavshamir.springwolf.example.kafka.dtos.AnotherPayloadDto",
"properties": {
"example": {
"description": "Example payload model",
"description": "Example payload model demonstrating markdown text styling:\n**bold**, *cursive* and <u>underlined</u>\n",
"name": "io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto",
"properties": {
"someEnum": {
Expand All @@ -549,7 +549,7 @@
"type": "integer"
},
"someString": {
"description": "Some string field",
"description": "### Some string field with Markdown\n\n- **bold**\n- *cursive*\n- images: <img src=\"./assets/springwolf-logo.png\" alt=\"Springwolf\" height=\"50\"/>\n- and code blocks (json, http, java)\n ```json\n {\n \"key1\":\"value1\",\n \"key2\":\"value2\"\n }\n ```\n",
"name": "someString",
"type": "string"
}
Expand Down Expand Up @@ -597,19 +597,19 @@
},
"someString": {
"type": "string",
"description": "Some string field",
"description": "### Some string field with Markdown\n\n- **bold**\n- *cursive*\n- images: <img src=\"./assets/springwolf-logo.png\" alt=\"Springwolf\" height=\"50\"/>\n- and code blocks (json, http, java)\n ```json\n {\n \"key1\":\"value1\",\n \"key2\":\"value2\"\n }\n ```\n",
"example": "some string value"
}
},
"description": "Example payload model",
"description": "Example payload model demonstrating markdown text styling:\n**bold**, *cursive* and <u>underlined</u>\n",
"example": {
"someEnum": "FOO2",
"someLong": 5,
"someString": "some string value"
},
"x-json-schema": {
"$schema": "https://json-schema.org/draft-04/schema#",
"description": "Example payload model",
"description": "Example payload model demonstrating markdown text styling:\n**bold**, *cursive* and <u>underlined</u>\n",
"name": "io.github.stavshamir.springwolf.example.kafka.dtos.ExamplePayloadDto",
"properties": {
"someEnum": {
Expand All @@ -629,7 +629,7 @@
"type": "integer"
},
"someString": {
"description": "Some string field",
"description": "### Some string field with Markdown\n\n- **bold**\n- *cursive*\n- images: <img src=\"./assets/springwolf-logo.png\" alt=\"Springwolf\" height=\"50\"/>\n- and code blocks (json, http, java)\n ```json\n {\n \"key1\":\"value1\",\n \"key2\":\"value2\"\n }\n ```\n",
"name": "someString",
"type": "string"
}
Expand Down
11 changes: 9 additions & 2 deletions springwolf-ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"./node_modules/font-awesome/css/font-awesome.min.css",
"src/main.css"
"src/main.css",
"./node_modules/prismjs/themes/prism-okaidia.css"
],
"scripts": []
"scripts": [
"./node_modules/prismjs/prism.js",
"./node_modules/prismjs/components/prism-json.min.js",
"./node_modules/prismjs/components/prism-http.min.js",
"./node_modules/prismjs/components/prism-java.min.js",
"./node_modules/prismjs/components/prism-kotlin.min.js"
]
},
"configurations": {
"production": {
Expand Down
Loading

0 comments on commit 2e0b8a0

Please sign in to comment.