Replace deprecated code (#14639)

This commit is contained in:
Beppe Catanese 2023-02-07 14:52:19 +01:00 committed by GitHub
parent bbc42696ab
commit 031115356d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,9 +37,9 @@ public class GoModelTest {
public void simpleModelTest() {
final Schema model = new Schema()
.description("a sample model")
.addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT))
.addProperties("name", new StringSchema())
.addProperties("createdAt", new DateTimeSchema())
.addProperty("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT))
.addProperty("name", new StringSchema())
.addProperty("createdAt", new DateTimeSchema())
.addRequiredItem("id")
.addRequiredItem("name");
final DefaultCodegen codegen = new GoClientCodegen();
@ -85,8 +85,8 @@ public class GoModelTest {
public void listPropertyTest() {
final Schema model = new Schema()
.description("a sample model")
.addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT))
.addProperties("urls", new ArraySchema()
.addProperty("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT))
.addProperty("urls", new ArraySchema()
.items(new StringSchema()))
.addRequiredItem("id");
final DefaultCodegen codegen = new GoClientCodegen();
@ -122,7 +122,7 @@ public class GoModelTest {
public void mapPropertyTest() {
final Schema model = new Schema()
.description("a sample model")
.addProperties("translations", new MapSchema()
.addProperty("translations", new MapSchema()
.additionalProperties(new StringSchema()))
.addRequiredItem("id");
final DefaultCodegen codegen = new GoClientCodegen();
@ -150,7 +150,7 @@ public class GoModelTest {
public void complexPropertyTest() {
final Schema model = new Schema()
.description("a sample model")
.addProperties("children", new Schema().$ref("#/definitions/Children"));
.addProperty("children", new Schema().$ref("#/definitions/Children"));
final DefaultCodegen codegen = new GoClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
codegen.setOpenAPI(openAPI);
@ -173,7 +173,7 @@ public class GoModelTest {
public void complexListProperty() {
final Schema model = new Schema()
.description("a sample model")
.addProperties("children", new ArraySchema()
.addProperty("children", new ArraySchema()
.items(new Schema().$ref("#/definitions/Children")));
final DefaultCodegen codegen = new GoClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);
@ -199,7 +199,7 @@ public class GoModelTest {
public void complexMapProperty() {
final Schema model = new Schema()
.description("a sample model")
.addProperties("children", new MapSchema()
.addProperty("children", new MapSchema()
.additionalProperties(new Schema().$ref("#/definitions/Children")));
final DefaultCodegen codegen = new GoClientCodegen();
OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model);