Skip to content

Commit 82ea15c

Browse files
committed
Compatibility test RequestBody
1 parent 7e57371 commit 82ea15c

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package org.openapitools.openapidiff.core.backcompat;
2+
3+
import static org.openapitools.openapidiff.core.TestUtils.assertOpenApiBackwardIncompatible;
4+
import static org.openapitools.openapidiff.core.TestUtils.assertSpecUnchanged;
5+
6+
import org.junit.jupiter.api.Test;
7+
8+
public class RequestBodyBCTest {
9+
private final String BASE = "bc_request_body_base.yaml";
10+
11+
@Test
12+
public void unchanged() {
13+
assertSpecUnchanged(BASE, BASE);
14+
}
15+
16+
@Test
17+
public void requiredChanged() {
18+
assertOpenApiBackwardIncompatible(BASE, "bc_request_body_required_changed.yaml");
19+
}
20+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
openapi: 3.0.0
2+
info:
3+
description: myDesc
4+
title: myTitle
5+
version: 1.0.0
6+
paths:
7+
/widgets:
8+
post:
9+
operationId: widgetCreate
10+
requestBody:
11+
content:
12+
application/json:
13+
schema:
14+
type: string
15+
responses:
16+
'200':
17+
description: successful operation
18+
content:
19+
application/json:
20+
schema:
21+
type: string
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
openapi: 3.0.0
2+
info:
3+
description: myDesc
4+
title: myTitle
5+
version: 1.0.0
6+
paths:
7+
/widgets:
8+
post:
9+
operationId: widgetCreate
10+
requestBody:
11+
content:
12+
application/json:
13+
schema:
14+
type: string
15+
required: true
16+
responses:
17+
'200':
18+
description: successful operation
19+
content:
20+
application/json:
21+
schema:
22+
type: string

0 commit comments

Comments
 (0)