Skip to content

Commit

Permalink
version 1.5 - error handling and readability improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Bartosz Michalik <[email protected]>
  • Loading branch information
bartoszm committed Jun 7, 2021
1 parent 6e2d4c2 commit 19b6a22
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 20 deletions.
69 changes: 50 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,46 +26,68 @@ NAME

SYNOPSIS
sonata-blending-tool-cli generate
(-c <configuration file> | --config <configuration file>) [(-d <product specifications root directory> | --product-spec-root-dir <product specifications root directory>)]
[(-e <files encoding> | -encoding <files encoding>)]
(-i <spec file> | --input-spec <spec file>)
[(-m <model to be augmented> | --model-name <model to be augmented>)]
[(-p <product specifications> | --product-spec <product specifications>)...]
[--strict-mode]
[ {-b | --blending-schema} <specifications to be blend (integrate) in>... ]
[ {-c | --config} <configuration file> ]
[ {-d | --product-spec-root-dir} <product specifications root directory> ]
[ {-e | -encoding} <files encoding> ]
[ {-i | --input-spec} <spec file> ]
[ {-m | --model-name} <model to be augmented> ]
[ {-p | --product-spec} <product specifications>... ]
[ --strict-mode ]

OPTIONS
-b <specifications to be blend (integrate) in>, --blending-schema
<specifications to be blend (integrate) in>
sets of specifications (e.g. specific product or service
definitions) you would like to integrate

This option is part of the group 'allOrSelective' from which only
one option may be specified


-c <configuration file>, --config <configuration file>
Path to configuration file configuration file. It can be json or
yaml.If file is json, the content should have the format
{"optionKey":"optionValue", "optionKey1":"optionValue1"...}.If file
is yaml, the content should have the format optionKey:
optionValueSupported options can be different for each language. Run
config-help -g {generator name} command for language specific config
options.
optionValueSupported options can be different for each language.
Run config-help -g {generator name} command for language specific
config options.

This option may occur a maximum of 1 times


-d <product specifications root directory>, --product-spec-root-dir
<product specifications root directory>
sets of product specification root directory for specifications you
would like to integrate

-e <files encoding>, -encoding <files encoding>
encoding used to read API and product definitions. By default system
encoding is used
encoding used to read API and product definitions. By default
system encoding is used

-i <spec file>, --input-spec <spec file>
location of the OpenAPI spec, as URL or file (required)

This option may occur a maximum of 1 times


-m <model to be augmented>, --model-name <model to be augmented>
Model which will be hosting product specific extensions (e.g.
MEFProductConfiguration)

-p <product specifications>, --product-spec <product specifications>
sets of product specification you would like to integrate

This option is part of the group 'allOrSelective' from which only
one option may be specified


--strict-mode
Verify that model to be augmented allows for extension (contains
discriminator definition). If strict-mode is `false` tool will add a
discriminator on the fly if possible.
discriminator definition).
If strict-mode is `false` tool will add a discriminator on the fly
if possible.

```
Expand All @@ -75,7 +97,7 @@ Assuming you have a valid spring generator configuration
(as explained [here](https://openapi-generator.tech/docs/generators/spring)) in `configurations/spring`
```shell script
java -jar blender-1.4.jar generate -d ./schemas/POQ/ -p Access_E_Line_OVC.yaml -p Carrier_Ethernet_Operator_UNI.yaml \
java -jar blender-1.5.jar generate -d ./schemas/POQ/ -b Access_E_Line_OVC.yaml -b Carrier_Ethernet_Operator_UNI.yaml \
-c ./configurations/spring/spring-server.yaml
-i ./api/serviceability/offeringQualification/productOfferingQualificationManagement.api.yaml
```
Expand All @@ -91,6 +113,7 @@ NAME

SYNOPSIS
sonata-blending-tool-cli blend
[ {-b | --blending-schema} <specifications to be blend (integrate) in>... ]
[ {-d | --product-spec-root-dir} <product specifications root directory> ]
[ {-e | -encoding} <files encoding> ]
[ {-i | --input-spec} <spec file> ]
Expand All @@ -99,6 +122,15 @@ SYNOPSIS
[ --sorted ] [ --strict-mode ]

OPTIONS
-b <specifications to be blend (integrate) in>, --blending-schema
<specifications to be blend (integrate) in>
sets of specifications (e.g. specific product or service
definitions) you would like to integrate

This option is part of the group 'allOrSelective' from which only
one option may be specified


-d <product specifications root directory>, --product-spec-root-dir
<product specifications root directory>
sets of product specification root directory for specifications you
Expand Down Expand Up @@ -135,16 +167,15 @@ OPTIONS
Verify that model to be augmented allows for extension (contains
discriminator definition).
If strict-mode is `false` tool will add a discriminator on the fly
if possible.

if possible.
```
### Usage example for Sonata
Assumption is that this command is run from root of the Sonata SDK directory and jar file is in the same directory.
```shell script
java -jar blender-1.4.jar blend -d ./schemas -p POQ/Access_E_Line_OVC.yaml -p POQ/Carrier_Ethernet_Operator_UNI.yaml \
java -jar blender-1.5.jar blend -d ./schemas/POQ -b Access_E_Line_OVC.yaml -b Carrier_Ethernet_Operator_UNI.yaml \
-i ./api/serviceability/offeringQualification/productOfferingQualificationManagement.api.yaml
```
Expand All @@ -153,7 +184,7 @@ java -jar blender-1.4.jar blend -d ./schemas -p POQ/Access_E_Line_OVC.yaml -p PO
Assumption is that this command is run from root of the Legato SDK directory and jar file is in the same directory.
```shell script
java -jar blender-1.4.jar blend -d spec/legato/carrierEthernet -m MefServiceConfiguration \
java -jar blender-1.5.jar blend -d spec/legato/carrierEthernet -m MefServiceConfiguration \
-i ./api/legato/serviceProvisioning/serviceOrdering/v4/serviceOrderingApi.openapi.yaml \
-p carrierEthernetOvc.yaml -p carrierEthernetSubscriberUni.yaml
-b carrierEthernetOvc.yaml -b carrierEthernetSubscriberUni.yaml
```
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<groupId>com.amartus.sonata</groupId>
<artifactId>blender</artifactId>
<description>SonataBlendingTool</description>
<version>1.5-SNAPSHOT</version>
<version>1.5</version>
<properties>
<!-- <openapi.generator.version>4.3.1</openapi.generator.version>-->
<openapi.generator.version>5.0.0-beta3</openapi.generator.version>
Expand Down

0 comments on commit 19b6a22

Please sign in to comment.