mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-18 22:57:07 +00:00
Merge remote-tracking branch 'origin/master' into 5.4.x
This commit is contained in:
@@ -86,7 +86,7 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
|
||||
"--markdown-header"}, title = "markdown header", description = "When format=markdown, include this option to write out markdown headers (e.g. for docusaurus).")
|
||||
private Boolean markdownHeader;
|
||||
|
||||
@Option(name = {"--full-details"}, title = "full generator details", description = "displays CLI options as well as other configs/mappings (implies --instantiation-types, --reserved-words, --language-specific-primitives, --import-mappings, --supporting-files)")
|
||||
@Option(name = {"--full-details"}, title = "full generator details", description = "displays CLI options as well as other configs/mappings (implies --instantiation-types, --reserved-words, --language-specific-primitives, --import-mappings, --feature-set)")
|
||||
private Boolean fullDetails;
|
||||
|
||||
private String newline = System.lineSeparator();
|
||||
|
||||
@@ -22,7 +22,9 @@ import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.mockito.MockSettings;
|
||||
import org.openapitools.codegen.DefaultGenerator;
|
||||
import org.openapitools.codegen.Generator;
|
||||
import org.openapitools.codegen.SpecValidationException;
|
||||
import org.openapitools.codegen.config.CodegenConfigurator;
|
||||
import org.testng.TestException;
|
||||
import org.testng.annotations.AfterMethod;
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.Test;
|
||||
@@ -430,4 +432,12 @@ public class GenerateTest {
|
||||
verify(configurator).toContext();
|
||||
verifyNoMoreInteractions(configurator);
|
||||
}
|
||||
|
||||
/**
|
||||
* This test ensures that when the
|
||||
*/
|
||||
@Test(expectedExceptions = SpecValidationException.class)
|
||||
public void testNPEWithInvalidSpecFile() {
|
||||
setupAndRunTest("-i", "src/test/resources/npe-test.yaml", "-g", "java", "-o", "src/main/java", false, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
test:
|
||||
get:
|
||||
responses:
|
||||
'200':
|
||||
description: test
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
prop1:
|
||||
type: array
|
||||
prop2:
|
||||
type: date
|
||||
@@ -0,0 +1,8 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
description: test
|
||||
version: test
|
||||
title: test
|
||||
paths:
|
||||
/test:
|
||||
$ref: 'npe-test-spec-file.yaml#/test'
|
||||
Reference in New Issue
Block a user