You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "Aled Sage (JIRA)" <ji...@apache.org> on 2016/07/04 19:37:10 UTC

[jira] [Commented] (BROOKLYN-236) Catalog version ignores trailing zero: 1.10 treated as 1.1

    [ https://issues.apache.org/jira/browse/BROOKLYN-236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15361735#comment-15361735 ] 

Aled Sage commented on BROOKLYN-236:
------------------------------------

Our examples have been changed to include quotes, and the docs now say "Also note YAML treats numbers differently to Strings. Explicit quotes are recommended, to avoid {{1.10}} being interpretted as the number {{1.1}}." 

See:
* https://github.com/apache/brooklyn-server/pull/222
* https://github.com/apache/brooklyn-docs/pull/82
* https://github.com/apache/brooklyn-library/pull/46

> Catalog version ignores trailing zero: 1.10 treated as 1.1
> ----------------------------------------------------------
>
>                 Key: BROOKLYN-236
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-236
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Aled Sage
>
> With Brooklyn 0.9.0-SNAPSHOT.
> Add the example catalog item below - once with version {{1.2}} and once with versoin {{1.10}}. When you look in the catalog, it shows versions 1.1 and 1.2 (instead of 1.10 and 1.2).
> If you put the version number in quotes (e.g. {{version: "1.10"}}) then it works as expected.
> Presumably the problem is in the YAML parsing: it interprets the value as a double rather than a String, so throws away the zero at the end.
> {noformat}
> brooklyn.catalog:
>   id: SimpleExample
>   version: 1.10
>   displayName: SimpleExample
>   itemType: template
>   item:
>     services:
>     - type: org.apache.brooklyn.entity.stock.BasicApplication
> {noformat}
> Should we:
> * change all our examples to put the version in quotes, so it is a string?
> * try to parse this YAML value differently (but then we can't just rely on the normal YAML parsing of {{org.yaml.snakeyaml.Yaml().loadAll(yaml}}?)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)