[java][okhttp-gson-nextgen] better oneOf implementation (#11146)

* add validJsonObject method

* add check for null

* fix list model generation

* fix optional fields validation

* add tests

* fix variable naming

* update tests

* add fromJson in oneOf, add tests

* convert JSON to static

* remove trailing space

* add fromString methods to all models

* add toJson, fix anyOf template

* remove workarounds

* undo changes to tests

* skip file schema test

* add new file
This commit is contained in:
William Cheng
2021-12-18 23:22:55 +08:00
committed by GitHub
parent d65bf8d1a6
commit b72eba90cd
247 changed files with 16330 additions and 1135 deletions

View File

@@ -0,0 +1,48 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.junit.jupiter.api.Test;
/**
* Model tests for ModelFile
*/
class ModelFileTest {
private final ModelFile model = new ModelFile();
/**
* Model tests for ModelFile
*/
@Test
void testModelFile() {
// TODO: test ModelFile
}
/**
* Test the property 'sourceURI'
*/
@Test
void sourceURITest() {
// TODO: test sourceURI
}
}

View File

@@ -0,0 +1,48 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.junit.jupiter.api.Test;
/**
* Model tests for ModelList
*/
class ModelListTest {
private final ModelList model = new ModelList();
/**
* Model tests for ModelList
*/
@Test
void testModelList() {
// TODO: test ModelList
}
/**
* Test the property '_123list'
*/
@Test
void _123listTest() {
// TODO: test _123list
}
}