Skip to content

Commit

Permalink
Deprecate --uuid
Browse files Browse the repository at this point in the history
Also improve printout for -e

Signed-off-by: Erik Jaegervall <[email protected]>
  • Loading branch information
erikbosch committed Mar 11, 2024
1 parent 469bfa3 commit 1ae7015
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ For VSS-Tools 4.0 the following behavior is implemented:
* No warning is given if neither `--uuid` nor `--no-uuid` is used.
* If both `--uuid` and `--no-uuid` is used an error is given.

### Default unit fileremoved from vss-tools
### Default unit file removed from vss-tools

The default unit file `config.yaml`
has been removed from VSS-tools. This means that either a file `units.yaml` in the same directory as the `*.vspec`
Expand All @@ -88,7 +88,7 @@ From now on, if new units are needed for the VSS catalog they shall be added to
[VSS catalog file](https://github.com/COVESA/vehicle_signal_specification/blob/master/spec/units.yaml).


## Implemented changes, not yet released in major version
## Implemented changes, to be released as part of VSS-Tools 5.0

### Struct support in vspec2ddsidl

Expand All @@ -111,4 +111,17 @@ if units refer to a quantity that has not been defined an information message wi

### Change in UUID handling.

As the tool [vspec2id](docs/vspec2id.md) has been added the VSS-project has agreed that there no longer is a need to support
the legacy uuid functionality.

* The parameter `--no-uuid` is now removed, and an error is given if `--no-uuid` is used.
* The parameter `--uuid` is now deprecated.

## Planned changes for VSS-Tools 6.0

### Change in UUID handling.

As the tool [vspec2id](docs/vspec2id.md) has been added the VSS-project has agreed that there no longer is a need to support
the legacy uuid functionality.

* The parameter `--uuid` is now removed.
14 changes: 8 additions & 6 deletions docs/vspec2x.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ of the node and the UUID of the namespace `vehicle_signal_specification`.

This setting may not apply to all exporters, some exporters will never output uuids.

*NOTE: The UUID feature is deprecated and will be removed in VSS-tools 6.0. If you need identifiers consider using [vspec2id](vspec2id.md)*

### --no-expand

By default all tools expand instance information so that instance information like "Row1" become a branch just like
Expand Down Expand Up @@ -94,7 +96,7 @@ Please see [test cases](https://github.com/COVESA/vss-tools/tree/master/tests/vs
python vspec2json.py --json-pretty -vt VehicleDataTypes.vspec -ot VehicleDataTypes.json test.vspec out.json
```

Current status for exportes:
Current status for exporters:

* CSV, JSON, YAML, Protobuf: Supported!
* All other exporters: Not supported!
Expand Down Expand Up @@ -305,12 +307,12 @@ __Note: Not all exporters (need to) support (all) extended metadata attributes!_
Lets the exporter generate _all_ extended metadata attributes found in the model. By default the exporter is generating only those given by the `-e`/`--extended-attributes` parameter.
### --json-pretty
If the paramter is set it will pretty-print the JSON output, otherwise you will get a minimized version
If the parameter is set it will pretty-print the JSON output, otherwise you will get a minimized version
## JSONSCHEMA exporter notes
### --jsonschema-all-extended-attributes
Lets the exporter generate _all_ extended metadata attributes found in the model. By default the exporter is generating only those given by the `-e`/`--extended-attributes` parameter. This will also add unconverted VSS standard attribtues into the schema using the following attributes
Lets the exporter generate _all_ extended metadata attributes found in the model. By default the exporter is generating only those given by the `-e`/`--extended-attributes` parameter. This will also add unconverted VSS standard attributes into the schema using the following attributes
| VSS attribute | in schema |
|---------------|---------------|
Expand All @@ -321,18 +323,18 @@ Lets the exporter generate _all_ extended metadata attributes found in the model
| comment | x-comment |
| uuid | x-uuid |
Not that strict JSON schema validators might not accept jsonschemas whoch such extra, non-standard entries.
Not that strict JSON schema validators might not accept jsonschemas with such extra, non-standard entries.
### --jsonschema-disallow-additional-properties
Do not allow properties not defined in VSS tree, when elements are validated agains the schema, what this basically does is setting
Do not allow properties not defined in VSS tree, when elements are validated against the schema, what this basically does is setting
```json
"additionalProperties": false
```
for all defined objects. See: https://json-schema.org/draft/2020-12/json-schema-core#additionalProperties

### --jsonschema-require-all-properties
Require all elements defined in VSS tree for a valid object, i.e. this populates the `required` list with all childs. See: https://json-schema.org/draft/2020-12/json-schema-validation#name-required
Require all elements defined in VSS tree for a valid object, i.e. this populates the `required` list with all children. See: https://json-schema.org/draft/2020-12/json-schema-validation#name-required

### --jsonschema-pretty
If the paramter is set it will pretty-print the JSON output, otherwise you will get a minimized version
Expand Down
16 changes: 11 additions & 5 deletions vspec/vspec2x.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def main(self, arguments):
help=" Terminate naming style not follows recommendations.")
if self.vspec2vss_config.uuid_supported:
parser.add_argument('--uuid', action='store_true',
help='Include uuid in generated files.')
help='Include uuid in generated files. (Deprecated, will be removed in VSS-tools 6.0)')
if self.vspec2vss_config.expand_model and self.vspec2vss_config.no_expand_option_supported:
parser.add_argument('--no-expand', action='store_true',
help='Do not expand tree.')
Expand Down Expand Up @@ -97,16 +97,22 @@ def main(self, arguments):
if args.abort_on_name_style or args.strict:
abort_on_namestyle = True

if self.vspec2vss_config.extended_attributes_supported:
if self.vspec2vss_config.extended_attributes_supported and (len(args.extended_attributes) > 0):
known_extended_attributes_list = args.extended_attributes.split(",")
if len(known_extended_attributes_list) > 0:
vspec.model.vsstree.VSSNode.whitelisted_extended_attributes = known_extended_attributes_list
logging.info(f"Known extended attributes: {', '.join(known_extended_attributes_list)}")
vspec.model.vsstree.VSSNode.whitelisted_extended_attributes = known_extended_attributes_list
logging.info(f"Known extended attributes: {', '.join(known_extended_attributes_list)}")
else:
known_extended_attributes_list = list()

self.vspec2vss_config.generate_uuid = self.vspec2vss_config.uuid_supported and args.uuid

# Follow up to https://github.com/COVESA/vehicle_signal_specification/pull/721
# Deprecate --uuid
if self.vspec2vss_config.generate_uuid:
logging.warning("The argument --uuid is deprecated and the uuid feature is planned "
"to be removed in VSS-tools 6.0")
logging.info("If you need static identifiers consider using the vspec2id tool")

self.vspec2vss_config.expand_model = (self.vspec2vss_config.expand_model and not
(self.vspec2vss_config.no_expand_option_supported and args.no_expand))

Expand Down

0 comments on commit 1ae7015

Please sign in to comment.