mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
Replace deprecated code (#14639)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user