Skip to content

Commit 4c550e5

Browse files
committed
added sample
1 parent a7c8a9e commit 4c550e5

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
openapi-processor-mapping: v2
2+
3+
options:
4+
package-name: io.openapiprocessor.generated
5+
6+
map:
7+
# map a result wrapper
8+
result: io.micronaut.http.HttpResponse
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
openapi-processor-mapping: v2
2+
3+
options:
4+
package-name: io.openapiprocessor.generated
5+
6+
map:
7+
# map a result wrapper
8+
result: org.springframework.http.ResponseEntity

mapping-response-wrapper/openapi.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
openapi: 3.0.2
2+
info:
3+
title: result mapping
4+
version: 1.0.0
5+
6+
paths:
7+
/response:
8+
get:
9+
tags:
10+
- endpoint
11+
responses:
12+
'200':
13+
description: simple result
14+
content:
15+
text/plain:
16+
schema:
17+
type: string
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "map a result wrapper",
3+
"description": "wrap the endpoint result with a response wrapper to configure response properties.",
4+
"openapi": "openapi.yaml",
5+
"mapping": {
6+
"spring": "mapping-spring.yaml",
7+
"micronaut": "mapping-micronaut.yaml"
8+
}
9+
}

0 commit comments

Comments
 (0)