From 7e494e52abb7ae730259537b02d75be333958df7 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 26 Jul 2018 23:10:15 +0800 Subject: [PATCH] Various improvements (#653) * improve validation error message * minor improvement to qt5 c++ server * fix invalid spec (causing shippable failure) * Revert "minor improvement to qt5 c++ server" This reverts commit 56f356cc511479d7a039309afed6328a7865f4b7. --- .../org/openapitools/codegen/config/CodegenConfigurator.java | 5 ++++- .../petstore-with-fake-endpoints-models-for-testing.yaml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index 96492e5251c..2e2c7da0b56 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -535,7 +535,10 @@ public class CodegenConfigurator implements Serializable { } if (this.isValidateSpec()) { - SpecValidationException ex = new SpecValidationException("Specification has failed validation."); + StringBuilder sb = new StringBuilder(); + sb.append("There were issues with the specification. The option can be disabled by passing false to skipValidateSpec (Maven/Gradle) or --skip-validate-spec (CLI)."); + sb.append(System.lineSeparator()); + SpecValidationException ex = new SpecValidationException(sb.toString()); ex.setErrors(validationMessages); ex.setWarnings(warnings); throw ex; diff --git a/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml index c7205a8e0ea..2bc345dab4e 100644 --- a/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml @@ -556,7 +556,7 @@ paths: tags: - "fake_classname_tags 123#$%^" summary: To test class name in snake case - descriptions: To test class name in snake case + description: To test class name in snake case operationId: testClassname consumes: - application/json