Coder Social home page Coder Social logo

backbase / backbase-openapi-tools Goto Github PK

View Code? Open in Web Editor NEW
40.0 11.0 23.0 5.66 MB

Backbase Open Api Tools (boat) helps manage large OpenAPI projects

License: Other

Java 11.30% HTML 0.24% Shell 0.41% Scala 0.02% CSS 0.08% Handlebars 0.14% JavaScript 14.07% Kotlin 2.05% Mustache 71.68%
java openapi3 openapi maven maven-plugin swagger

backbase-openapi-tools's Introduction

Build Quality Gate Status Mvn Central

Backbase OpenApi Tools

The Backbase Open API Tools is a collection of tools created to work efficiently with OpenAPI

It currently consists of

  • Create Diff Report between 2 OpenAPI versions of the same spec (Based on https://github.com/quen2404/openapi-diff)
  • Decompose Transformer to remove Composed Schemas from OpenAPI specs to aid in code generators
  • Case Transformer to view how your API looks like when going from Camel Case to Snake Case (transforms examples too)
  • Code Generator based on openapi-generator.tech with optimized templates and fixes.
  • Lint mojo based on Zalando Zally and Backbase API

Release Notes

BOAT is still under development and subject to change.

0.17.36

  • Lint rule B014 doesn't throw a null exception when parsing a string array property in a schema.

0.17.35

  • ISSUE: #776 add new lint rule B014 - to validate if examples contain all defined properties in the schema
  • BOAT now supports multiple access control permissions within the tag x-BbAccessControls in the OpenAPI spec. It contains two parameters description which describes the relationship between the permissions and permissions which is an array of permissions with tags resource, function and privilege.
  • Improve generated client Class Name
  • Fix Jakarta native client generation options

0.17.30

  • Angular 17

0.17.29

  • Fixed Spring deprecations

0.17.24

0.17.23

  • Boat Engine
    • Added support for byte array examples
  • Boat Scaffold
    • Removed tag import in order to allow BOAT objects to have the name 'tag'

0.17.22

  • boat-maven-plugin
    • Issue 211: Fix typo in changelogRenderer parameter in DiffMojo.java (#652) @talbot

0.17.21

  • boat-spring, boat-java
    • Issue 649: missing BigDecimalCustomSerializer.java (#650) @walaniam
  • BOAT Android (#637) @charbelmkh

0.17.18

  • boat-spring
    • Fix [Regression on putting valid annotation on FQCN,#619]
    • Fix [Broken pojo field validations, #633]
    • Fix Add @NotNull for required properties.
    • Fix initiation of required property that has additionalProperties (generated as Map) when using containerDefaultToNull=true
    • Fix createApiComponent option in springtemplate generator is ignored
    • Fix #635
    • Fix [List of Maps of Strings generated code does not compile. ,#647]

0.17.16

  • BOAT Angular Generator
    • added @angular/common as peer dependency in the generated package.json files
    • replace usages of isListContainer with isArray in api.service template

0.17.15

  • boat-spring
    • fix: incorrectly used enum param on collection items (see collectionDataTypeParam.mustache)

0.17.14

  • boat-spring
    • added validation constraints on primitive collection items types in request params (see collectionDataTypeParam.mustache)
    • added validation constraints on primitive map value types (see mapDataType.mustache)

0.17.13

  • boat-spring
    • Fix: generate validation constraints on primitive collection items types (updates in pojo.mustache and new collectionDataType.mustache)

0.17.12

  • BoatJavaCodeGen, BoatSpringCodeGen
    • Fix: Always generate collection initializer when array is required in the schema (even if containerDefaultToNull=true)
    • Fix: validated pojo referenced class causes invalid code to be generated
    • Fix: boat-java pojo template to support useWithModifier to generate withSomething methods; fixes referencing 'common' classes generated using boat-spring templates.

0.17.11

  • BoatJavaCodeGen, BoatSpringCodeGen
    • Fix: always generate collection initializer when array is required in the schema (even if containerDefaultToNull=true)

0.17.10

  • Boat maven plugin
    • Fix: When using Multipart, generate with @RequestPart instead of @RequestParam

0.17.9

0.17.8

0.17.7

  • Boat maven plugin
    • Fix: Added 'containerDefaultToNull' default option to the MOJO generator

0.17.6

  • Boat engine
    • Fix: Processing of a single string type example on media-type.

0.17.4

  • Boat Angular generator
    • New format for Angular mocks, which are now export an array with responses.

0.17.3

  • Boat Angular generator
    • Map the Set type to Array by default to avoid breaking changes vs clients generated with 0.16.x.

0.17.2

  • Boat Angular generator
    • Remove leading comment from typescript files so that there are fewer differences between files when regenerating with a new spec version (info moved to README)
    • Remove licence field from package.json

0.17.1

  • Boat Angular generator
    • Added artifact information to generated package.json

0.17.0

  • General
    • Removed RAML Support
    • Removed custom JavaScript client
    • Update OpenAPI Tools to 6.2.1
  • Boat Java Generator
    • Jakarta EE 9 compatibility
    • spring-mvc library is removed because it is not supported by OpenAPI Tools anymore
    • Use of Set for unique items is now enabled by default as OpenAPI Generator fixed their implementation

0.16.15

  • Boat engine
    • Fix: Processing of a single string type example on media-type.
  • Boat Angular generator
    • New format for Angular mocks, which are now export an array with responses.

0.16.13

  • Boat Angular generator
    • @angular/common added as a peer dependency in the generated package.json files

0.16.12

  • Boat Angular generator
    • Remove leading comment from typescript files so that there are fewer differences between files when regenerating with a new spec version (info moved to README)
    • Remove licence field from package.json

0.16.11

  • Boat Angular generator
    • Set removeComments: false in generated tsconfig.json files to retain /*#__PURE__*/ annotation in compiled JS.

0.16.10

  • Boat Angular generator
    • Remove types from generated mock providers due to a TypeScript which prevents /*#__PURE__*/ annotation from working

0.16.9

  • Boat Angular generator
    • Use of /*#__PURE__*/ for createMocks function call in templates to enable tree-shaking

0.16.6

  • Boat Angular generator
    • Use ^ instead of >= for devDependencies in the generated project, so project will be built using correct target version of ng-packagr & the Angular CLI
    • Declare some extra devDependencies at explicit versions to fix npm install issues in the generated project when using npm v8

0.16.5

  • Boat Angular generator
    • Allow any format for spec versions.

0.16.4

  • Boat Angular generator
    • Add ability to bake the spec version used in the package.json file.

0.16.3

  • Maven Plugin
    • Do not treat spaces as delimiters in configuration properties which take a comma-separated list of values. Fixes an issue that prevented the use of tag names containing spaces in the apisToGenerate property.

0.16.2

  • Boat Angular generator
    • Specify minimum Angular-related package versions when Angular v13 is used

0.16.1

  • Boat Java generator
    • Java 17 compatibility update

0.16.0

  • Boat Angular generator
    • Use >= for main peer dependency to improve forward compatibility

0.15.8

  • Boat Scaffold
    • Makes sure to not autogenerate examples from schema if examples are already present

0.15.6

  • Maven Plugin
    • Add example of use the additional properties like createApiComponent
  • Boat Angular generator
    • Generate the ng-package.json file for use with the ng-package CLI

0.15.5

  • Boat Lint
  • Bumped version of Zally Linting Libraries that contain several vulnerability fixes

0.15.4

  • Boat Angular generator
    • Enable partial Ivy compilation for libraries.

0.15.3

  • Boat Scaffold
  • A fix for mapping of Map for query params (in client code).

0.15.2

  • Maven Plugin
    • Fixed handling of absolute file paths for linting OpenAPI specs
    • Changed boat-bay dateLibrary for upload spec .

0.15.1

  • Maven Plugin
    • Made boat:radio goal properties w.r.t boat-bay server unique.

0.15.0

0.14.12

  • Boat Scaffold
    • References to /examples/foo now are also dereferenced

0.14.10

  • Boat Scaffold
    • Makes sure to URLDecode paths while dereferencing examples

0.14.9

  • Boat Scaffold
    • Resolve references to other path operations' examples

0.14.8

  • Boat Marina
    • Removes flatObjects as they are no longer needed
    • response.message was wrongfully escaped, escaping in the docs template instead
    • We no longer need to generate model aliases in boat marina

0.14.7

  • Boat Marina
    • Exports flatObjects as a model to prevent errors with references

0.14.6

  • Maven Plugin
    • Added boat:ship mojo to automagically zip specs found in src/main/resources and attach it to the project reactor so mvn install or mvn deploy will also include a zip archive of the project with with api classifier
    • Changed boat:bundle includes parameter to an array of patterns to allow recursive patters to discover OpenAPIs
  • Boat Scaffold
    • Fixed bug in typescript generator where only one of the overloaded function signatures per deprecated endpoint was marked as deprecated.

0.14.5

  • Boat Marina
    • Added boat-markers directory in target to keep track of successful and unsuccessful actions on OpenAPI specs

0.14.4

  • Boat Marina

    • Added a now BOAT Scaffold template called Marina, as that is where the models hang out. The Boat Marina template outputs a single JSON file that is used to offer a rich user interface built from the specs including search, page per operation and many more features!
  • Maven Plugin

    • The boat:doc goal now recursively search OpenAPI specs in a directory to generate docs for each found spec.

0.14.3

0.14.2

  • Angular Generator
    • Added support for Angular version ranges in peer dependencies

0.14.1

  • Angular Generator
    • Added support for Angular 11

0.14.0

  • Angular Generator
    • Simplify Angular generator options by removing the unused ones (withInterfaces,providedInRoot)
    • fix Mock is not generated if Http status equals to 201 (SDK-2388)

0.13.0

  • Lint
    • Added rules.
      • Check plurals on paths resource names.
      • Check prefix for paths should contain version.
    • Enabled rules.
      • Use Standard HTTP Status Codes.

0.12.0

  • General
    • Improved code quality
    • Added more unit tests
    • Added more realistic example projects in boat-maven-plugin
    • Added help:describe support for boat-maven-plugin
    • Fixed building in Windows
  • Boat Docs
    • Render response examples from response instead of schema object
  • Lint
    • Added additional rules.
      • Check x-icon value in the info block.
      • Check info block description.
      • Check tags allowed.
      • Check info block title.
      • Check prefix for paths. i.e. "client-api", "service-api", "integration-api"
    • Ignore Zalando Ruleset by default in boat-maven-plugin

0.11.4

  • Java Templates

    • Correct the import and use of @Qualifier in ApiClient template
    • Only change base type when date useSetForUniqueNames is set true
  • Boat Docs

    • Handle examples for MediaTypes without Schemas (such as text/csv)

0.11.3

  • Angular Generator
    • Apply the correct return type when multiple responses are present
    • Generate mocks for examples defined in dereferenced schemas

0.11.1

  • Java Generator - boat-spring library
    • Fixed reactive spring templates
    • Avoid importing HttpServletResponse when using reactive
  • Angular Generator
    • Handle empty bodies properly in Mock generation
    • Update foundation-ang to latest version

0.11.0

  • Maven Plugin

    • Added removeExtensions mojo parameter to boat:bundle to filter out the given vendor extensions from bundle.
    • Added includes mojo parameter to boat:bundle as a glob pattern selecting the specification files (defaults to *.yaml).
    • Added apisToGenerate mojo parameter to boat:generate
    • Set the default of httpUserAgent to ${project.artifactId}-${project.version}.
  • Java Generator - resttemplate library

    • Added useWithModifiers option to use the with prefix for POJO modifiers (defaults to false).
    • added useSetForUniqueItems to map arrays containing uniqueItems to Set (defaults to false).
    • Added useClassLevelBeanValidation option (defaults to false).
    • Added useJacksonConversion to use Jackson for parameters conversion instead of toString (defaults to false).
    • Added restTemplateBeanName to qualify the autowired RestTemplate bean.
  • Angular Generator

    • Added an Angular client generator for version 10 and up. The generator template is inherited from the standard one at openapi-generator.tech, with the addition of mock responses and a several fixes, among which:
      • Handling of reserved typescript words
      • Added support for Typescript and Javascript for escaping of strings in generators
      • Escaping of model properties when not using camelCase
      • Support for multiple MediaTypes
    • To enable mocks generation, set the withMocks option to true

0.10.0

  • Maven Plugin
    • boat:lint mojo will generate an HTML report based on API Guidelines
    • boat:docs mojo will generate HTML documentation from OpenAPI showing multiple examples and requests as well as Custom Annotations
  • General Bug Fixes
  • Linting Rule Engine extended with reserved word linting
  • NOTE: The lint rules are still in development. The documentation is still in the works.

0.9.0

  • Maven Plugin
    • Added version parameter to bundle goal.
    • Added bundleSpecs parameter to generate goal to automatically bundle specs into single file
  • Modernised BOAT Terminal
  • Improved BOAT:Docs Templates
  • Properly dereference examples

0.8.0

  • Improved styling HTML docs
  • preview BOAT:QUAY linting mojo for linting OpenAPI specs.
  • Avoid circular references when derefenencing OpenAPI specs

0.7.0

  • Render multiple requests and examples in boat-docs

  • Created HTML templates for boat-docs

  • Pretty Print JSON Examples

  • Added boat:doc mojo for generating beautiful HTML2 docs

    • Spring Generator*
    • Restored HttpServletRequest parameter (regression).
  • Added boat:yard to create static website based on a collection of specs

0.6.0

  • simple fix to check for null value in openApi.getComponents().getSchemas()
  • ability to resolve references like #/components/schemas/myObject/items or #/components/schemas/myObject/properties/embeddedObject
  • simple fix to avoid npe in StaticHtml2Generation escaping response message.

0.5.0

  • Add DereferenceComponentsPropertiesTransformer (that does a bit extra)
  • Fix recursive referencing in UnAliasTransformer

0.4.0

  • Added bundle skip
  • Changed numbering scheme

0.3.0

  • Maven Plugin

    • Added bundle.skip parameter to bundle goal (defaults to false).
  • HTML2 Generator

    • Removes examples
    • Adds title of API to the left navigation
    • Removes unnecessary spaces in the docs
    • Fixes item focus on left navigation
    • Updates Json Schema Ref Parser library
    • Updates Json schema view library
    • Adds support for allOf with Json schema merge all of https://github.com/mokkabonna/json-schema-merge-allof
    • Fixes header x- params being escaped. eg X-Total-Count to XMinusTotalMunisCount
    • Fixes markdown in description not being escaped and breaking javascript.
    • Fixes missing references to extended simple types (set unAlias option to true).
    • Fixes missing references because confusion over whether to reference name or classname.
    • Moved the code generation into a separate module to be used by other BOAT components.
    • Cleaning up dependencies
    • Added boat:bundle mojo to bundle fragments into a single spec.
    • boat:bundle unaliases the spec.
  • Spring Generator

    • Added useWithModifiers to use the with prefix for POJO modifiers (defaults to false; for compatibility with the old RAML generator must be set to true).
    • Fixed x-abstract extension (not generated)
    • Reset the defaults of the options added in 0.2.7 to avoid breaking changes.
      • useLombokAnnotations: false
      • openApiNullable: true
      • useSetForUniqueItems: false

0.2.7

  • Spring Generator

    • added in-container validation, e.g. List<@Size(max = 36) String> (see JSR-380 - Container element constraints).
    • added vendor extensions: x-abstract, x-implements.
    • added useLombokAnnotations option (defaults to true)
    • added openApiNullable option (taken from 5.0, breaking change, defaults to false, set to true if not ready).
    • added useSetForUniqueItems to map arrays with uniqueItems to Set instead of List (breaking change, defaults to true, set to false if not ready).
    • added additionalDependencies to be used in spring-boot/pom.mustache template.
    • formatted method parameters.
  • Maven Plugin

    • added addTestCompileSourceRoot which adds the output directory to the project as a test source root.
    • added apiNameSuffix to customise the name of the API interface.
    • corrected generatorName property to point to openapi.generator.maven.plugin.generatorName.
    • fixed the code generated for properties of type Map in model.
    • refactored GenerateMojo so mvn boat:generate -Dcodegen.configHelp -Dopenapi.generator.maven.plugin.generatorName=spring works correctly.
    • test the generated code in the integration test phase

0.2.6

  • Ensure RAML traits that are converted to OAS extensions are all using lower case.

0.2.5

  • Fixed a bug how duplicate names are generated if RAML source has duplicate names for references. The parent resource name is now prepended to the schema name without removing the last character of the parent resource name
  • Fixed a bug when in RAML resources were inline references instead of global type references for Request Bodies causing Response Schemas being referenced as Request Bodies

0.2.4 - Breaking Change!

  • Changed how operationIds are generated. The previous implementation ended up generating very long and confusing names. The improved generator greatly improves the names of operationId when converting from RAML to OAS3
  • Default version of OpenAPI is now 3.0.3
  • Generated STUBS and Clients must be refactored to use the new names! It should not affect the names of Schemas converted from RAML.

0.2.3

  • Use RAML Display Name as Summary on Http Operations when converting to OAS3
  • Also include integration-spec and artifacts ending on specs as default for conversion using export-dep
  • Fix HTML2 Titles

0.2.2

  • Fixed enum conversion. Empty enums are now set to null again when converting from raml to OpenAPI
  • Added more robust code gen mojos

0.2.1

  • Improved Open API Diff
  • Sonar Fixes

0.2.0

  • Created new Code Generation Mojos with opinionated settings for ** Java Client with Spring WebClient (Reactive) ** Java Server Stubs for WebFlux (Reactive) ** Java Client with Spring Rest Template (Non Reactive) ** Java Server Stubs for Spring Rest Controller (Non Reactive) ** Improved Java Client API's to better cope with reserved words
  • Export Dependencies will now traverse through the artifact to find all raml specs
  • Improved RAML 2 Open API conversion
  • Upgraded OpenAPI Diff library to more current version
  • Mojo's can now break the build by setting continueOnError to false

0.1.9

  • Improved how services are named after base url conversion was introduced.

0.1.8

  • Reversed normalization of schema names as that causes stack overflow errors.
  • Fixed Base URL Conversion from RAML to OpenAPI
  • Specify schema type when adding additional properties in Maven plugin using additionalPropertiesType configuration option

0.1.7

  • Added configurable flag to add HttpServletRequest parameters to codegen'd server stubs.
  • Extract inline examples from the obtained OpenAPI spec and put them under '/examples/' as json files.
  • Changed the normalization of Schema Names to ensure existing casing is not lost

0.1.6

  • Added documentation on boat-maven-plugin
  • Upgraded YAML Libraries to improve output of YAML files
  • Use standardized swagger YAML output
  • Added Bean Validator in Code Generator
  • Changed Open API Loader to correctly resolve references from reading input location instead of string

0.1.5

  • Upgraded openapi-generator to 4.3.0
  • Fixed java doc in the Java templates to allow usage in Java 11 projects
  • Rename variable name accept to acceptMediaType in Java templates to allow OpenAPI Specs with parameters called accept

0.1.4

  • Fixed template for HTML2 generator
  • Include conversion of api.raml files found in dependencies

0.1.3

  • Added Code Generator Mojo from on openapi-generator.tech with custom templates for Java, JavaSpring and HTML2
  • Renamed export to export-dep mojo for converting RAML specs to oas from dependencies
  • Added export mojo for converting RAML specs from input file
  • Added Normaliser transformer for transforming examples names to be used in Java code generation as example names cannot have special characters.
  • Improve Title and Descriptions of converted RAML specs
  • Always wrap examples in example object
  • Many code improvements to be not ashamed of Sonar Reports.

Build & Install

mvn install

Maven Plugin Usage

The following command will generate index.html file in the specified output folder that contains API endpoints description.

mvn boat:generate@generate-docs

Generate API interfaces

Configuration

<build>
  <plugins>
    <plugin>
      <groupId>com.backbase.oss</groupId>
      <artifactId>boat-maven-plugin</artifactId>
      <version>${boat-maven-plugin.version}</version>
      <executions>
        <execution>
          <id>generate-api-code</id>
          <goals>
            <goal>generate</goal>
          </goals>
          <phase>generate-sources</phase>
          <configuration>
            <inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec>
            <output>${project.build.directory}/generated-sources/api</output>
            <generatorName>spring</generatorName>
            [...]
            <configOptions>
              <library>spring-boot</library>
              <apiPackage>com.example.my.service.api.interfaces</apiPackage>
              <modelPackage>com.example.my.service.models</modelPackage>
              <hideGenerationTimestamp>true</hideGenerationTimestamp>
              <dateLibrary>java8</dateLibrary>
              <interfaceOnly>true</interfaceOnly>
              <skipDefaultInterface>true</skipDefaultInterface>
              <useBeanValidation>true</useBeanValidation>
              <useTags>true</useTags>
              <java8>true</java8>
              <useOptional>false</useOptional>
              [...]
            </configOptions>
          </configuration>
        </execution>
      </executions>
    </plugin>
 </plugins>
</build>

A comprehensive list of the Configuration options can be found below.

Option Property Description
verbose openapi.generator.maven.plugin.verbose verbose mode (false by default)
inputSpec openapi.generator.maven.plugin.inputSpec OpenAPI Spec file path
language openapi.generator.maven.plugin.language target generation language (deprecated, replaced by generatorName as values here don't represent only 'language' any longer)
generatorName openapi.generator.maven.plugin.generatorName target generator name
output openapi.generator.maven.plugin.output target output path (default is ${project.build.directory}/generated-sources/openapi. Can also be set globally through the openapi.generator.maven.plugin.output property)
gitHost openapi.generator.maven.plugin.gitHost The git host, e.g. gitlab.com
gitUserId openapi.generator.maven.plugin.gitUserId sets git information of the project
gitRepoId openapi.generator.maven.plugin.gitRepoId sets the repo ID (e.g. openapi-generator)
templateDirectory openapi.generator.maven.plugin.templateDirectory directory with mustache templates
templateResourcePath openapi.generator.maven.plugin.templateResourcePath directory with mustache templates via resource path. This option will overwrite any option defined in templateDirectory.
engine openapi.generator.maven.plugin.engine The name of templating engine to use, "mustache" (default) or "handlebars" (beta)
auth openapi.generator.maven.plugin.auth adds authorization headers when fetching the OpenAPI definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values
configurationFile openapi.generator.maven.plugin.configurationFile Path to separate json configuration file. File content should be in a json format {"optionKey":"optionValue", "optionKey1":"optionValue1"...} Supported options can be different for each language. Run config-help -g {generator name} command for language specific config options
skipOverwrite openapi.generator.maven.plugin.skipOverwrite Specifies if the existing files should be overwritten during the generation. (false by default)
apiPackage openapi.generator.maven.plugin.apiPackage the package to use for generated api objects/classes
modelPackage openapi.generator.maven.plugin.modelPackage the package to use for generated model objects/classes
invokerPackage openapi.generator.maven.plugin.invokerPackage the package to use for the generated invoker objects
packageName openapi.generator.maven.plugin.packageName the default package name to use for the generated objects
groupId openapi.generator.maven.plugin.groupId sets project information in generated pom.xml/build.gradle or other build script. Language-specific conversions occur in non-jvm generators
artifactId openapi.generator.maven.plugin.artifactId sets project information in generated pom.xml/build.gradle or other build script. Language-specific conversions occur in non-jvm generators
artifactVersion openapi.generator.maven.plugin.artifactVersion sets project information in generated pom.xml/build.gradle or other build script. Language-specific conversions occur in non-jvm generators
library openapi.generator.maven.plugin.library library template (sub-template)
modelNamePrefix openapi.generator.maven.plugin.modelNamePrefix Sets the prefix for model classes and enums
modelNameSuffix openapi.generator.maven.plugin.modelNameSuffix Sets the suffix for model classes and enums
ignoreFileOverride openapi.generator.maven.plugin.ignoreFileOverride specifies the full path to a .openapi-generator-ignore used for pattern based overrides of generated outputs
httpUserAgent openapi.generator.maven.plugin.httpUserAgent Sets custom User-Agent header value
removeOperationIdPrefix openapi.generator.maven.plugin.removeOperationIdPrefix remove operationId prefix (e.g. user_getName => getName)
logToStderr openapi.generator.maven.plugin.logToStderr write all log messages (not just errors) to STDOUT
enablePostProcessFile openapi.generator.maven.plugin. enable file post-processing hook
skipValidateSpec openapi.generator.maven.plugin.skipValidateSpec Whether or not to skip validating the input spec prior to generation. By default, invalid specifications will result in an error.
strictSpec openapi.generator.maven.plugin.strictSpec Whether or not to treat an input document strictly against the spec. 'MUST' and 'SHALL' wording in OpenAPI spec is strictly adhered to. e.g. when false, no fixes will be applied to documents which pass validation but don't follow the spec.
generateAliasAsModel openapi.generator.maven.plugin.generateAliasAsModel generate alias (array, map) as model
configOptions N/A a map of language-specific parameters. To show a full list of generator-specified parameters (options), please use configHelp (explained below)
instantiationTypes openapi.generator.maven.plugin.instantiationTypes sets instantiation type mappings in the format of type=instantiatedType,type=instantiatedType. For example (in Java): array=ArrayList,map=HashMap. In other words array types will get instantiated as ArrayList in generated code. You can also have multiple occurrences of this option
importMappings openapi.generator.maven.plugin.importMappings specifies mappings between a given class and the import that should be used for that class in the format of type=import,type=import. You can also have multiple occurrences of this option
typeMappings openapi.generator.maven.plugin.typeMappings sets mappings between OpenAPI spec types and generated code types in the format of OpenAPIType=generatedType,OpenAPIType=generatedType. For example: array=List,map=Map,string=String. You can also have multiple occurrences of this option
languageSpecificPrimitives openapi.generator.maven.plugin.languageSpecificPrimitives specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double. You can also have multiple occurrences of this option
additionalProperties openapi.generator.maven.plugin.additionalProperties sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value. You can also have multiple occurrences of this option
serverVariableOverrides openapi.generator.maven.plugin.serverVariableOverrides A map of server variable overrides for specs that support server URL templating
reservedWordsMappings openapi.generator.maven.plugin.reservedWordsMappings specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used. For example id=identifier. You can also have multiple occurrences of this option
generateApis openapi.generator.maven.plugin.generateApis generate the apis (true by default). Specific apis may be defined as a CSV via apisToGenerate.
apisToGenerate openapi.generator.maven.plugin.apisToGenerate A comma separated list of apis to generate. All apis is the default.
generateModels openapi.generator.maven.plugin.generateModels generate the models (true by default). Specific models may be defined as a CSV via modelsToGenerate.
modelsToGenerate openapi.generator.maven.plugin.modelsToGenerate A comma separated list of models to generate. All models is the default.
generateSupportingFiles openapi.generator.maven.plugin.generateSupportingFiles generate the supporting files (true by default)
supportingFilesToGenerate openapi.generator.maven.plugin.supportingFilesToGenerate A comma separated list of supporting files to generate. All files is the default.
generateModelTests openapi.generator.maven.plugin.generateModelTests generate the model tests (true by default. Only available if generateModels is true)
generateModelDocumentation openapi.generator.maven.plugin.generateModelDocumentation generate the model documentation (true by default. Only available if generateModels is true)
generateApiTests openapi.generator.maven.plugin.generateApiTests generate the api tests (true by default. Only available if generateApis is true)
generateApiDocumentation openapi.generator.maven.plugin.generateApiDocumentation generate the api documentation (true by default. Only available if generateApis is true)
withXml openapi.generator.maven.plugin.withXml enable XML annotations inside the generated models and API (only works with Java language and libraries that provide support for JSON and XML)
skip codegen.skip skip code generation (false by default. Can also be set globally through the codegen.skip property)
skipIfSpecIsUnchanged codegen.skipIfSpecIsUnchanged Skip the execution if the source file is older than the output folder (false by default. Can also be set globally through the codegen.skipIfSpecIsUnchanged property)
addCompileSourceRoot openapi.generator.maven.plugin.addCompileSourceRoot Add the output directory to the project as a source root, so that the generated java types are compiled and included in the project artifact (true by default). Mutually exclusive with addTestCompileSourceRoot.
addTestCompileSourceRoot openapi.generator.maven.plugin.addTestCompileSourceRoot Add the output directory to the project as a test source root, so that the generated java types are compiled only for the test classpath of the project (false by default). Mutually exclusive with addCompileSourceRoot.
environmentVariables N/A A map of items conceptually similar to "environment variables" or "system properties". These are merged into a map of global settings available to all aspects of the generation flow. Use this map for any options documented elsewhere as systemProperties.
configHelp codegen.configHelp dumps the configuration help for the specified library (generates no sources)

For the spring generator, the additional configuration options are:

Option Description
sortParamsByRequiredFlag Sort method arguments to place required parameters before optional parameters. (Default: true)
sortModelPropertiesByRequiredFlag Sort model properties to place required parameters before optional parameters. (Default: true)
ensureUniqueParams Whether to ensure parameter names are unique in an operation (rename parameters that are not). (Default: true)
allowUnicodeIdentifiers boolean, toggles whether unicode identifiers are allowed in names or not, default is false (Default: false)
prependFormOrBodyParameters Add form or body parameters to the beginning of the parameter list. (Default: false)
modelPackage package for generated models (Default: org.openapitools.model)
apiPackage package for generated api classes (Default: org.openapitools.api)
invokerPackage root package for generated code (Default: org.openapitools.api)
groupId groupId in generated pom.xml (Default: org.openapitools)
artifactId artifactId in generated pom.xml. This also becomes part of the generated library's filename (Default: openapi-spring)
artifactVersion artifact version in generated pom.xml. This also becomes part of the generated library's filename (Default: 1.0.0)
artifactUrl artifact URL in generated pom.xml (Default: https://github.com/openapitools/openapi-generator)
artifactDescription artifact description in generated pom.xml (Default: OpenAPI Java)
scmConnection SCM connection in generated pom.xml (Default: scm:git:[email protected]:openapitools/openapi-generator.git)
scmDeveloperConnection SCM developer connection in generated pom.xml (Default: scm:git:[email protected]:openapitools/openapi-generator.git)
scmUrl SCM URL in generated pom.xml (Default: https://github.com/openapitools/openapi-generator)
developerName developer name in generated pom.xml (Default: OpenAPI-Generator Contributors)
developerEmail developer email in generated pom.xml (Default: [email protected])
developerOrganization developer organization in generated pom.xml (Default: OpenAPITools.org)
developerOrganizationUrl developer organization URL in generated pom.xml (Default: http://openapitools.org)
licenseName The name of the license (Default: Unlicense)
licenseUrl The URL of the license (Default: http://unlicense.org)
sourceFolder source folder for generated code (Default: src/main/java)
serializableModel boolean - toggle "implements Serializable" for generated models (Default: false)
bigDecimalAsString Treat BigDecimal values as Strings to avoid precision loss. (Default: false)
fullJavaUtil whether to use fully qualified name for classes under java.util. This option only works for Java API client (Default: false)
hideGenerationTimestamp Hides the generation timestamp when files are generated. (Default: false)
withXml whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML) (Default: false)
dateLibrary Option. Date library to use (Default: threetenbp)
joda - Joda (for legacy app only)
legacy - Legacy java.util.Date (if you really have a good reason not to use threetenbp
java8-localdatetime - Java 8 using LocalDateTime (for legacy app only)
java8 - Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
threetenbp - Backport of JSR310 (preferred for jdk < 1.8)
java8 Option. Use Java8 classes instead of third party equivalents (Default: false)
true - Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used
false - Various third party libraries as needed
disableHtmlEscaping Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields) (Default: false)
booleanGetterPrefix Set booleanGetterPrefix (Default: get)
additionalModelTypeAnnotations Additional annotations for model type(class level annotations)
parentGroupId parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
parentArtifactId parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
parentVersion parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect
snapshotVersion Uses a SNAPSHOT version. true - Use a SnapShot Versionfalse - Use a Release Version
title server title name or client service name (Default: OpenAPI Spring)
configPackage configuration package for generated code (Default: org.openapitools.configuration)
basePackage base package (invokerPackage) for generated code (Default: org.openapitools)
interfaceOnly Whether to generate only API interface stubs without the server files. (Default: false)
delegatePattern Whether to generate the server files using the delegate pattern (Default: false)
singleContentTypes Whether to select only one produces/consumes content-type by operation. (Default: false)
skipDefaultInterface Whether to generate default implementations for java8 interfaces (Default: false)
async use async Callable controllers (Default: false)
reactive wrap responses in Mono/Flux Reactor types (spring-boot only) (Default: false)
responseWrapper wrap the responses in given type (Future, Callable, CompletableFuture,ListenableFuture, DeferredResult, HystrixCommand, RxObservable, RxSingle or fully qualified type)
virtualService Generates the virtual service. For more details refer - https://github.com/elan-venture/virtualan/wiki (Default: false)
useTags use tags for creating interface and controller classnames (Default: false)
useBeanValidation Use BeanValidation API annotations (Default: true)
performBeanValidation Use Bean Validation Impl. to perform BeanValidation (Default: false)
useClassLevelBeanValidation Adds @Validated annotation to API interfaces (Default: false)
useLombokAnnotations Use Lombok annotations to generate properties accessors and hashCode/equals methods (Default: false)
addServletRequest Adds ServletRequest objects to API method definitions (Default: false)
addBindingResult Adds BindingResult to Api method definitions' request bodies if UseBeanValidation true, for this to be effective you must configure UseBeanValidation, this is not done automatically (Default: false)
implicitHeaders Skip header parameters in the generated API methods using @ApiImplicitParams annotation. (Default: false)
swaggerDocketConfig Generate Spring OpenAPI Docket configuration class. (Default: false)
apiFirst Generate the API from the OAI spec at server compile time (API first approach) (Default: false)
useOptional Use Optional container for optional parameters (Default: false)
hateoas Use Spring HATEOAS library to allow adding HATEOAS links (Default: false)
returnSuccessCode Generated server returns 2xx code (Default: false)
unhandledException Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring @ControllerAdvice directives). (Default: false)
library library template (sub-template) (Default: spring-boot)
spring-boot - Spring-boot Server application using the SpringFox integration.
spring-mvc - Spring-MVC Server application using the SpringFox integration.
spring-cloud - Spring-Cloud-Feign client with Spring-Boot auto-configured settings.

backbase-openapi-tools's People

Contributors

actions-user avatar alyahmedaly avatar ankypant avatar arundathibb avatar bartv-bb avatar bartveenstra avatar charbelmkh avatar christopherm-backbase avatar daiscog avatar dependabot[bot] avatar devagani avatar dhananjay12 avatar ebru-backbase avatar fnxpt avatar fredysierra avatar harrymartin678 avatar jjjasper avatar manisha-backbase avatar miladbb avatar ngohungphuc avatar nlr234 avatar ntgussoni avatar pa314159 avatar sadib avatar santam85 avatar skellig-s avatar sophiejanssens avatar stevewyatt74 avatar torrespro avatar walaniam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backbase-openapi-tools's Issues

Release 0.14.2 - <serializableModel>true</serializableModel> appending comma(,) automatically in generated source

Hi Team,
I am trying to generate source using above version i.e 0.14.2 , while I am putting
<configuration> ..... <configOptions> <serializableModel>true</serializableModel> </configOptions> </configuration>
in my pom.xml. I am doing mvn clean install to generate the source file from yaml spec. The source file is getting generated with implementing Serializable interface as well. But the problem is it is automatically appending comma after it which is giving me build failure and showing this error [31,4] illegal start of type. I am attaching a screenshot for the same for a more clearer picture.
Can someone please help me for this.
Thanks,
8C4F306D-392A-44A8-A0BA-8212F864666E_1_201_a

Allow the generate mojos (lint, doc, code gen, etc) to be able to read the specs from maven artefacts coordinates

Instead of pointing to a single file as we do with inputSpec the idea is to create a new property in the configuration inputMavenArtifact to be able to download the artifact, unzip it and then generate code from it. Because our zips contain multiple yaml files and versions we need a param to specify the fileName.

https://github.com/Backbase/blade/blob/cdebbc6c462c691d1354c003b0d66b875982329f/blade-maven-plugin/src/main/java/com/backbase/oss/blade/mojo/AbstractBladeMojo.java#L149

           <plugin>
                <groupId>com.backbase.oss</groupId>
                <artifactId>boat-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-client-api-code-v1</id>
                        <goals>
                            <goal>generate-spring-boot-embedded</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
<!--                            <inputSpec>${project.build.directory}/specs/review-service-api-v1.0.0.yaml</inputSpec>-->
                            <inputMavenArtifact>     
                                    <groupId>com.backbase.message</groupId>
                                    <artifactId>messaging-api</artifactId>
                                    <version>1.0.0-SNAPSHOT</version>
                                    <classifier>api</classifier>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <fileName>review-service-api-v1.0.0.yaml</fileName>
                            </inputMavenArtifact>
                            <apiPackage>com.backbase.reviews.api.service.v1</apiPackage>
                            <modelPackage>com.backbase.reviews.api.service.v1.model</modelPackage>
                        </configuration>
                    </execution>

BOAT NPM generate-sources fails when YAML spec file contains multiple tags

  • I am running the latest version
  • I checked the documentation and found no answer

Expected Behavior

Running mvn clean generate-sources -Pnpm -X would generate an NPM package from the YAML spec which compiles successfully with ng build.

Current Behavior

Running mvn clean generate-sources -Pnpm -X generates an NPM package from the YAML spec which fails to compile with ng build. The generated NPM package contains duplicate TypeScript interface names.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Generate a YAML spec containing a service with multiple tags, like the following excerpt:
  /client-api/test/v3/test/:
    description: >-
      The endpoint provides information
    get:
      parameters:
      operationId: getTests
      description: Get a list 
      tags:
        - Test
        - Test and Test
  1. Run mvn clean generate-sources -Pnpm -X
  • Plugin version: 0.16.2

Failure Logs


✖ Compiling with Angular sources in Ivy partial compilation mode.
[96mpublic_api.ts[0m:[93m12[0m:[93m1[0m - [91merror[0m[90m TS2308: [0mModule './api/cases.service' has already exported a member named 'GetEpicCumulativeStatusRequestParams'. Consider explicitly re-exporting to resolve the ambiguity.

[7m12[0m export * from './api/epicsAndMilestones.service';
[7m  [0m [91m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
[96mpublic_api.ts[0m:[93m12[0m:[93m1[0m - [91merror[0m[90m TS2308: [0mModule './api/cases.service' has already exported a member named 'GetEpicRequestParams'. Consider explicitly re-exporting to resolve the ambiguity.

[7m12[0m export * from './api/epicsAndMilestones.service';
[7m  [0m [91m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
[96mpublic_api.ts[0m:[93m12[0m:[93m1[0m - [91merror[0m[90m TS2308: [0mModule './api/cases.service' has already exported a member named 'GetEpicsGroupedByNameRequestParams'. Consider explicitly re-exporting to resolve the ambiguity.

[7m12[0m export * from './api/epicsAndMilestones.service';
[7m  [0m [91m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
[96mpublic_api.ts[0m:[93m12[0m:[93m1[0m - [91merror[0m[90m TS2308: [0mModule './api/cases.service' has already exported a member named 'GetEpicsRequestParams'. Consider explicitly re-exporting to resolve the ambiguity.

[7m12[0m export * from './api/epicsAndMilestones.service';
[7m  [0m [91m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
[96mpublic_api.ts[0m:[93m12[0m:[93m1[0m - [91merror[0m[90m TS2308: [0mModule './api/cases.service' has already exported a member named 'GetMilestonesRequestParams'. Consider explicitly re-exporting to resolve the ambiguity.

[7m12[0m export * from './api/epicsAndMilestones.service';
[7m  [0m [91m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m



option supportingFilesToGenerate does not work

In versions 0.2.6 and before this configuration works OK:

<configuration>
    <inputSpec>../../user-segment-spec/src/main/resources/client-api.yaml</inputSpec>
    <supportingFilesToGenerate>ApiUtil.java</supportingFilesToGenerate>
    <generatorName>spring</generatorName>
    <configOptions>
        <library>spring-boot</library>
        <apiPackage>com.backbase.platform.segmentation.usersegment.api</apiPackage>
        <modelPackage>com.backbase.platform.segmentation.usersegment.model</modelPackage>
        <hideGenerationTimestamp>true</hideGenerationTimestamp>
        <dateLibrary>java8</dateLibrary>
        <interfaceOnly>false</interfaceOnly>
        <useBeanValidation>true</useBeanValidation>
        <useTags>true</useTags>
        <java8>true</java8>
        <useOptional>false</useOptional>
        <delegatePattern>true</delegatePattern>
    </configOptions>
</configuration>

But in 0.2.7 and afterward it fails to generate the supporting files

Enum types are generated with "Enum" suffix

We have some types in our spec such as "Status" and "Type" which are currently being generated as "StatusEnum" and "TypeEnum".

It would be nice to be able to specify a name or have them generate without the suffix by default.

RFC: Remove Lombok.

Using lombok in the generated sources does not make sense. Lombok value is to keep source code readable and compact by avoiding boiler-plate getters and setters. Generated code is not meant to be looked at, it is not aimed to be pretty and nobody cares if it is boiler-plate because nobody maintains it.

Adding lombok support complicates solutions (having to take into account both with and without lombok)

boat-maven-plugin on windows: intermediate YAML files are created in Cp1252 encoding (instead of UTF-8)

Hi there,

We use the boat-maven-plugin in a project to create the API client from a OpenAPI specification. Some information about the OpenAPI spec:

  • it's a YAML file
  • stored at qr-scan-api/src/main/resources/qr-scan-client-api-*.yaml
  • UTF-8 encoded
  • contains several regex patterns for content validation
  • these patterns contain non-ASCII characters ("äöü" etc.)

There are tests in the project that assert the correctness of these validation patterns.

Building the project (mvn clean install) succeeds on the mac and linux but fails on windows. The failure reason is the tests that assert the correctness of the validation patterns: The patterns are messed up on windows.

The root cause for the failure is an intermediate YAML file created by the boat-maven-plugin:

  • located at qr-scan-api/target/qr-scan-client-api-*.yaml
  • encoded in Cp1252 on windows instead of UTF-8
    (there are more copies within the target folder at other locations - they're all Cp1252 encoded)

I attach both the original UTF-8 encoded YAML source file (src.yaml) and the intermediate YAML file in Cp1252 (target.yaml)
yaml.zip

Kind regards
Andreas

java.lang.NoSuchMethodError: org.yaml.snakeyaml.events.MappingStartEvent.<init>

When used as CLI like

cd boat-terminal

java -jar target/boat-terminal-0.1.7-jar-with-dependencies.jar   -f ../boat-engine/src/test/resources/raml-examples/helloworld/helloworld.raml

The output was

Exception in thread "main" java.lang.NoSuchMethodError: org.yaml.snakeyaml.events.MappingStartEvent.<init>(Ljava/lang/String;Ljava/lang/String;ZLorg/yaml/snakeyaml/error/Mark;Lorg/yaml/snakeyaml/error/Mark;Lorg/yaml/snakeyaml/DumperOptions$FlowStyle;)V at com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.writeStartObject(YAMLGenerator.java:551) at com.fasterxml.jackson.core.base.GeneratorBase.writeStartObject(GeneratorBase.java:294) at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:162) at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1433) at com.fasterxml.jackson.databind.ObjectWriter._configAndWriteValue(ObjectWriter.java:1135) at com.fasterxml.jackson.databind.ObjectWriter.writeValueAsString(ObjectWriter.java:1005) at io.swagger.v3.core.util.Yaml.pretty(Yaml.java:23) at com.backbase.oss.boat.serializer.SerializerUtils.toYamlString(SerializerUtils.java:26) at com.backbase.oss.boat.BoatTerminal.main(BoatTerminal.java:68)

containerDefaultToNull=true is not backward compatible

This PR containerDefaultToNull has changed default behaviour.

Generated code is invalid.

  @Valid
  private List<@Valid PaymentRequestLine> lines;

...

  @NotNull @Valid 
  @Schema(name = "lines", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("lines")
public List<@Valid PaymentRequestLine> getLines() {
  return lines;
}

By default there should be empty collection generated (with posibility to override it).

Negative numbers not converted to string correctly

I tried running one of the DBS specs (account-presentation-spec) through the converter and found that yaml validation failed on negative numbers in an example. If you look in the arrangements-with-balance-history-ex.json file, there's a section that looks like this:

        {
          "dateFrom": "2017-06-12T00:00:00.000Z",
          "dateTo": "2017-07-01T00:00:00.000Z",
          "value": {
            "currency": "EUR",
            "balance": "4"
          },
          "valuePtc": "4"
        },
        {
          "dateFrom": "2017-06-18T00:00:00.000Z",
          "dateTo": "2017-07-01T00:00:00.000Z",
          "value": {
            "currency": "EUR",
            "balance": "-14"
          },
          "valuePtc": "-14"
        }

It is the valuePtc at the bottom (set to "-14") that gets generated to yaml as this:

  - dateFrom: 2017-06-12T00:00:00.000Z
    dateTo: 2017-07-01T00:00:00.000Z
    value:
      currency: EUR
      balance: "4"
    valuePtc: "4"
  - dateFrom: 2017-06-18T00:00:00.000Z
    dateTo: 2017-07-01T00:00:00.000Z
    value:
      currency: EUR
      balance: -14
    valuePtc: -14

You can see the difference between between "4" and -14.

I debugged the code and tracked it down to the Jackson YAML library (jackson-dataformat-yaml) that's used to generate the YAML.

The regex that's used to determine the quote rules doesn't handle negative numbers correctly. See https://github.com/FasterXML/jackson-dataformats-text/blob/d69291651114b9e7a2ccbe1a3a154f2b84f95b30/yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/YAMLGenerator.java#L175

I'm working on a PR for the Jackson library and will link here once submitted.

Spec version in the file name of the bundled spec isn't available for client generation.

Scenario.
I'm using BOAT 0.11.0 to:

  1. Bundle the OpenAPI spec.
  2. Generate client for web.

Here is the plugins section of my pom.xml:

<plugins>
    <plugin>
        <groupId>com.backbase.oss</groupId>
        <artifactId>boat-maven-plugin</artifactId>
        <version>0.11.0</version>
        <executions>
            <execution>
                <id>bundle-specs</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>bundle</goal>
                </goals>
                <configuration>
                    <input>src/main/resources</input>
                    <output>${project.build.directory}</output>
                    <versionFileName>true</versionFileName>
                </configuration>
            </execution>
        </executions>
    </plugin>
    <plugin>
        ...
    </plugin>
    <plugin>
        <groupId>com.backbase.oss</groupId>
        <artifactId>boat-maven-plugin</artifactId>
        <version>${boat-maven-plugin.version}</version>
        <executions>
            <execution>
                <id>generate-client-code</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
                <configuration>
                    <inputSpec>${project.build.directory}/my-spec-client-api-v3.0.1.yaml</inputSpec>
                    <generatorName>boat-angular</generatorName>
                    <output>${project.build.directory}/http-module</output>
                    <additionalProperties>...</additionalProperties>
                </configuration>
            </execution>
        </executions>
    </plugin>
</plugins>

The first plugin call creates for me a file called my-spec-client-api-v3.0.1.yaml in the target folder, where 3.0.1 is the version property taken from my spec. I need it for my publishing mechanism.

The second call of the plugin (the one to generate client) don't have access to the version number, hence it's "hardcoded" in the example, which I'd like to avoid if possible.

I'd appreciate if you can advice me on how I can handle it. E.g. shall I try to restructure the pom file of mine and have 2 executions in one plugin?

DiffMojo typo in parameter name: changeLogRenderer

Using the diff goal from the Maven plugin will fail because of a typo in a parameter name.

[ERROR] Failed to execute goal com.backbase.oss:boat-maven-plugin:0.14.3:diff (diff) on project xyz: Unable to parse configuration of mojo com.backbase.oss:boat-maven-plugin:0.14.3:diff for parameter changeLogRenderer: Cannot find 'changeLogRenderer' in class com.backbase.oss.boat.DiffMojo -> [Help 1]

Caused by changeLogRenderer parameter, while the getter/setter/field are named changelogRenderer (note the casing of changelog vs changeLog).

get error when i try to consume spec openapi in service project backbase

I'm following A tutorial in backbase academy exactly in "Backbase Backend Essentials Course - Service SDK and Direct Integration Services" and i get error when i try to consume specification from service project , this is the error

exchange-rate-service: Compilation failure: Compilation failure: [ERROR] C:\Users\medamine\Desktop\retail-banking-training\direct-integration-services\exchange-rate-service\target\generated-sources\api\src\main\java\com\backbase\training\exchange\rate\api\service\v1\model\ExchangeRateItem.java:[49,96] error: cannot find symbol [ERROR] symbol: method requiredMode() [ERROR] location: @interface Schema

Missing validation constraints on collection items in request params

In case of request query param

      - name: ids
        in: query
        description: List of ids
        required: false
        style: form
        explode: true
        schema:
          maxItems: 50
          minItems: 1
          type: array
          description: List of ids
          items:
            $ref: '#/components/schemas/Uuid'
...
    Uuid:
      pattern: "^[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[1-5][0-9a-fA-F]{3}-?[89abAB][0-9a-fA-F]{3}-?[0-9a-fA-F]{12}$"
      type: string
      description: "Universal Unique Identifier, "

The validation (regex pattern) is missing on generated param

@RequestParam(value = "ids", required = false) java.util.List<String> ids

fileName attribute of inputMavenArtifact doesn't accept wildcard

I am using maven-boat-plugin version 0.14.8 where when using inputMavenArtifact feature of this plugin, I am unable to use wildcard character for version and plugin is forcing me to use exact version of open-api spec

slack conversation : https://backbase.slack.com/archives/CMU9PLZ5Z/p1629373147018900

<inputMavenArtifact>
                                <groupId>com.backbase.dbs.cards</groupId>
                                <artifactId>card-manager</artifactId>
                                <version>2.23</version>
                               <!-- <version>${card-management-api.version}</version>-->
                                <type>zip</type>
                                <classifier>api</classifier>
                                <overWrite>true</overWrite>
                                <fileName>card-manager/card-manager-client-api-v2.2.5.yaml</fileName>
</inputMavenArtifact>

boat-angular only deprecates one of the overloaded function signatures for deprecated operations

Current behaviour

The typescript client generated by boat-angular have several overloaded function signatures per operation depending on what the caller wants to observe as the result (i.e., return just the response body, the whole HttpResponse entity, or a stream of HTTP events).

When an operation is deprecated, only the first of these overloads are marked as deprecated:

Screenshot 2021-08-05 at 10 34 40

This means the IDE/linter of anyone using any of the other function signatures does not warn them that the endpoint is deprecated:

Screenshot 2021-08-05 at 10 34 46

(note only two of the calls are marked deprecated above)

Expected behaviour

All overloaded function signatures for a deprecated operation are marked as deprecated.

Error messages need more description when versions do not match

When doing mvn clean install on a syntactically correct specification with the file name of client-api-v2.yaml i receive the following errors depending on the version:

IF the version is version: v2 THEN i receive the following error:

Execution boat-bundle of goal com.backbase.oss:boat-maven-plugin:0.14.8:bundle failed: begin 0, end -1, length 2

IF the version is version: 2 THEN I receive the following error:

Execution boat-bundle of goal com.backbase.oss:boat-maven-plugin:0.14.8:bundle failed: begin 0, end -1, length 1

IF the version is version: 1.0.0 THEN i receive the following error:

Invalid version 1.0.0 in file /Users/dominick/projects/wsecu/digital-banking/dbs/wsecu-card-controls/wsecu-cards-controls-api/target/client-api-v2.yaml

SUCCESSFUL version combinations (from my brief testing) are:

  • version: 2.0.0
  • version: 2.
  • version: 2.0.
  • version: 2.bpibasdkn

Can we return a standardized and more descriptive error message when this is a problem in the code?

BoatSpringTemplatesTests fails on Windows OS

When running BoatSpringTemplatesTests on Windows OS it fails with StackOverflowError. This issue is related to swagger-api/swagger-parser#1886 , tested with proposed fix: swagger-api/swagger-parser#1959

java.lang.StackOverflowError
	at java.base/java.lang.StringLatin1.replace(StringLatin1.java:344)
	at java.base/java.lang.String.replace(String.java:2970)
	at org.openapitools.codegen.utils.ModelUtils.getSimpleRef(ModelUtils.java:401)
	at org.openapitools.codegen.utils.ModelUtils.getReferencedSchema(ModelUtils.java:802)
	at org.openapitools.codegen.DefaultCodegen.recursiveGetDiscriminator(DefaultCodegen.java:3237)
	at org.openapitools.codegen.DefaultCodegen.recursiveGetDiscriminator(DefaultCodegen.java:3252)
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at com.backbase.oss.codegen.java.BoatSpringTemplatesTests.invoke(BoatSpringTemplatesTests.java:159)
	at com.backbase.oss.codegen.java.BoatSpringTemplatesTests.lambda$testStream$3(BoatSpringTemplatesTests.java:154)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310)
	at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEachOrdered(ReferencePipeline.java:601)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because "this.files" is null
	at com.backbase.oss.codegen.java.BoatSpringTemplatesTests.findPattern(BoatSpringTemplatesTests.java:228)
	at com.backbase.oss.codegen.java.BoatSpringTemplatesTests.useLombokAnnotations(BoatSpringTemplatesTests.java:211)
	... 26 more

Bug: List of Maps of Strings generated code does not compile.

Schema type defined as

type: object
properties:
  challenges:
    type: array
    items:
      type: object
      additionalProperties:
        type: string
  data:
    type: object
    additionalProperties:
      type: string   

Results in

@Valid
private List<Map&lt;String, String&gt;> challenges;

Path issue on Windows when running unit tests.

Unit tests on windows fails because of this:

[ERROR] Failures:
[ERROR]   GeneratorTests.testBoatDocsWithNonExistingMarkersDirectory:162
Expecting:
  <java.nio.file.InvalidPathException: Trailing char < > at index 0:  \43243 \d a1r1♦t 11t134 t835jyz>
to be an instance of:
  <org.apache.maven.plugin.MojoExecutionException>
but was:
  <"java.nio.file.InvalidPathException: Trailing char < > at index 0:  \43243 \d a1r1♦t 11t134 t835jyz
        at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:172) 

inputMavenArtifact failing to rely on the dependencyManagement section

I am using maven-boat-plugin version 0.14.8 where when using inputMavenArtifact feature of this plugin, boat plugin is unable to inherit version of api-spec from dependency-management section.

slack conversation : https://backbase.slack.com/archives/CMU9PLZ5Z/p1629373147018900

Expected behaviour : inputMavenArtifact should recognise ${card-management-api.version} from dependency-management
Actual behaviour : Plugin failed to recognise the version and forced me to provide a exact version instead

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.backbase</groupId>
                <artifactId>backbase-bom</artifactId>
                <version>${backbase-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
<inputMavenArtifact>
                                <groupId>com.backbase.dbs.cards</groupId>
                                <artifactId>card-manager</artifactId>
                                <version>2.23</version>
                               <!-- <version>${card-management-api.version}</version>-->
                                <type>zip</type>
                                <classifier>api</classifier>
                                <overWrite>true</overWrite>
                                <fileName>card-manager/card-manager-client-api-v2.2.5.yaml</fileName>
</inputMavenArtifact>

Issue with accessing file path in windows os while generating backbase specification project

I am trying to create a backbase specification project and while doing mvn clean install for the project i am getting the below errors:

I think this is related only to windows operating system as it clearly that " : " is invalid in the path name, I am using 12.1.0 sdk version of the backbase.

[DEBUG] fixInlineExamples: 'ExampleHolder{name='null', ref=examples/body/example-message.json}', relative resolvedUri 'null'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.275 s
[INFO] Finished at: 2021-03-24T08:29:35+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.backbase.oss:boat-maven-plugin:0.13.0:bundle (boat-bundle) on project exchange-rate-specification2: Execution boat-bu
ndle of goal com.backbase.oss:boat-maven-plugin:0.13.0:bundle failed: Illegal char <:> at index 2: /C:/Users/rohitsinha4/backbase_dir/rohit/dis2/exchang
e-rate-specification2/src/main/resources/examples/body/example-message.json -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.backbase.oss:boat-maven-plugin:0.13.0:bundle (boat-bundle) on project
exchange-rate-specification2: Execution boat-bundle of goal com.backbase.oss:boat-maven-plugin:0.13.0:bundle failed: Illegal char <:> at index 2: /C:/U
sers/rohitsinha4/backbase_dir/rohit/dis2/exchange-rate-specification2/src/main/resources/examples/body/example-message.json
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution boat-bundle of goal com.backbase.oss:boat-maven-plugin:0.13.0:bundle failed: Ille
gal char <:> at index 2: /C:/Users/rohitsinha4/backbase_dir/rohit/dis2/exchange-rate-specification2/src/main/resources/examples/body/example-message.jso
n
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/rohitsinha4/backbase_dir/rohit/dis2/exchange-rate-specification2/s
rc/main/resources/examples/body/example-message.json
at sun.nio.fs.WindowsPathParser.normalize (WindowsPathParser.java:182)
at sun.nio.fs.WindowsPathParser.parse (WindowsPathParser.java:153)
at sun.nio.fs.WindowsPathParser.parse (WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse (WindowsPath.java:92)
at sun.nio.fs.WindowsFileSystem.getPath (WindowsFileSystem.java:229)
at java.nio.file.Path.of (Path.java:147)
at java.nio.file.Paths.get (Paths.java:69)
at com.backbase.oss.boat.transformers.bundler.ExamplesProcessor.fixInlineExamples (ExamplesProcessor.java:169)
at com.backbase.oss.boat.transformers.bundler.ExamplesProcessor.processMediaType (ExamplesProcessor.java:116)
at com.backbase.oss.boat.transformers.bundler.ExamplesProcessor.lambda$processExamples$2 (ExamplesProcessor.java:81)
at java.util.LinkedHashMap.forEach (LinkedHashMap.java:684)
at com.backbase.oss.boat.transformers.bundler.ExamplesProcessor.lambda$processExamples$3 (ExamplesProcessor.java:79)
at java.util.LinkedHashMap.forEach (LinkedHashMap.java:684)
at com.backbase.oss.boat.transformers.bundler.ExamplesProcessor.lambda$processExamples$4 (ExamplesProcessor.java:76)
at java.util.LinkedHashMap.forEach (LinkedHashMap.java:684)
at com.backbase.oss.boat.transformers.bundler.ExamplesProcessor.lambda$processExamples$5 (ExamplesProcessor.java:68)
at java.util.LinkedHashMap.forEach (LinkedHashMap.java:684)
at com.backbase.oss.boat.transformers.bundler.ExamplesProcessor.processExamples (ExamplesProcessor.java:66)
at com.backbase.oss.boat.transformers.bundler.BoatOpenAPIResolver.resolve (BoatOpenAPIResolver.java:44)
at com.backbase.oss.boat.transformers.Bundler.transform (Bundler.java:26)
at com.backbase.oss.boat.transformers.Transformer.transform (Transformer.java:12)
at com.backbase.oss.boat.BundleMojo.bundleOpenAPI (BundleMojo.java:118)
at com.backbase.oss.boat.BundleMojo.execute (BundleMojo.java:103)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

boat-angular generates uncompilable code when using bundleSpecs=true with an example array response

Given the following scenario:

  • An input spec which references external example files
  • An example file which contains a JSON array as the root node

Running the generate goal with generatorName=boat-angular and bundleSpecs=true results in uncompilable code in the generated mock provider(string literals are not enclosed in quotation marks).

Interestingly, if you add writeDebugFiles=true to output the bundled spec to a file, then run the generator against that file, the bug is not present.

Example project illustrating the issue https://github.com/daiscog/boat-angular-bundle-issue

`createApiComponent` option in springtemplate generator is ignored

Despite having

 <createApiComponent>false</createApiComponent>

the generated code is still coming out as

@jakarta.annotation.Generated(value = "com.backbase.oss.codegen.java.BoatJavaCodeGen", date = "2023-08-31T11:39:13.215034+02:00[Europe/Amsterdam]")
@Component("com.backbase.my.package.UsersClientApi")
public class UsersClientApi {

Serialization / deserialization issues of JsonSubTypes due to incorrect usage of JsonIgnoreProperties

When using schema with property type discriminator, there is a JsonIgnoreProperties added to generated class. Example

@JsonIgnoreProperties(
value = "paymentRequestType",
allowSetters = true
)

Due to missing allowGetters = true when serializing / deserializing a list of objects with such annotation, discriminator property is skipped during serialization and therefore it cannot be deserialized to proper type.

Regression: useBeanValidation broken from

bean validations are no longer generated on Pojo's starting 0.17.5

generator: boat-spring

having open-api property definition

  state:
    maxLength: 50
    minLength: 1
    type: string

0.17.4 generates

  @lombok.Getter
  @lombok.Setter
  @lombok.EqualsAndHashCode.Include
  @lombok.ToString.Include

      @NotNull @Size(min = 1, max = 50) 
      private String externalStateId;

0.17.5 generates

  @lombok.Getter
  @lombok.Setter
  @lombok.EqualsAndHashCode.Include
  @lombok.ToString.Include

      private String externalStateId;

0.17.16 is still broken

Boat export puts base uri in 'server url'.

When exporting from raml to openapi, when the raml file contains a baseUri, it is included in the 'servers' section rather than the paths. Additionally, the exporter includes the 'service-name' in the server section. Whether the 'service name' is part of the uri depends on the deployment of the service.

eg raml

baseUri=getting-started/v2

/helloworld:
  200:

OpenAPI after export

servers:
- url: /serviceName/getting-started/v2
  description: The server
...
paths:
  /helloworld:

Allow the inputSpec in the Docs goal to be a directory instead of a single file

If we could point to a folder we could generate the docs of multiple specs without the need for multiple executions.

Lint already supports dir:

@Parameter(name = "inputSpec", property = "inputSpec", required = true)

Adding nullable for object type changes generated code to JsonNullable

Without nullable object type boat is generating java Object type, which is desired behaviour as in our case field should be any Object(including possibility of primitives like boolean, int, etc.). However nullable added to spec, then JsonNullable is generated in java code as type of field, which breaks on parsing primitives.

Unit tests fails on Mac

Building project on Mac:

[ERROR] [c.b.o.b.Exporter] Error validating RAML document: src/test/resources/raml-examples/backbase-wallet/presentation-client-api.raml
[ERROR] [c.b.o.b.Exporter] Provided value Wed, 4 Jul 2001 12:08:56 PDT is not compliant with the format datetime provided in rfc2616 for example
[ERROR] [c.b.o.b.Exporter] Provided value Wed, 4 Jul 2001 12:08:56 PDT is not compliant with the format datetime provided in rfc2616 for example
[ERROR] [c.b.o.b.BoatTerminal] Error validation RAML
[ERROR] [c.b.o.b.BoatTerminal] Not found: /Users/pmarat/backbase/backbase-openapi-tools/backbase-openapi-tools/boat-terminal/src/test/resources/raml-examples/backbase-wallet/file-not-found
Unknown options: '--directory src/test/resources/raml-examples/converted', '--output src/test/resources/raml-examples/converted/openapi.yaml', '--convert-examples false'
Possible solutions: --directory
[ERROR] Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.995 s <<< FAILURE! - in com.backbase.oss.boat.BoatTerminalTest
[ERROR] testCLIOptions Time elapsed: 3.419 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: but was:
at com.backbase.oss.boat.BoatTerminalTest.testCLIOptions(BoatTerminalTest.java:26)

Constructor with required attributes is not generated correctly when there is inheritance.

This issue occurs when the first schema is defined in a "common" spec, or is an existing class, and a second spec refers to the previously generated class using `schemaMapping'

When a class defines a required property

    public AbstractSuperClass(String currency) {
      super();
          this.currency = currency;
    }

then the subclass

    /**
    * Constructor with only required parameters
    */
    public ConcreteSubClass(String currency) {
      super();
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.