Skip to content

Clarifies text in schema extension example #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions v2-0-RC3/doc/05SchemaExtensionMechanism.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,18 @@ If the *received version is less than the decoder's version* (that is, the produ

## Message schema extension example

Initial version of a message schema
The following example walks through changes to a schema to reinforce how schema
versioning works.

### Initial schema

Here's the initial example schema:
```xml
<messageSchema package="FIXBinaryTest" byteOrder="littleEndian">
<types>
<type name="int8" primitiveType="int8"/>
</types>

<types>
<type name="int8" primitiveType="int8"/>
</types>

<message name="FIX Binary Message1" id="1" blockLength="4">
<field name="Field1" id="1" type="int8" semanticType="int"/>
Expand All @@ -137,7 +142,13 @@ Initial version of a message schema
</messageSchema>
```

Second version - a new message is added
### Adding elements to the schema

Below adds new elements to the schema. Upon any update we must increment the
`version` attribute. When there is no `version` attribute, the version is zero.
Hence, our new version is one. This version applies to all change.

This update chooses to document updates with the `sinceVersion` attribute.

```xml
<messageSchema package="FIXBinaryTest" byteOrder="littleEndian"
Expand All @@ -161,7 +172,9 @@ Second version - a new message is added
</messageSchema>
```

Third version - a field is added
### Adding a field to a message

This update changes a message from the initial schema and adds a type.

```xml
<messageSchema package="FIXBinaryTest" byteOrder="littleEndian"
Expand All @@ -187,3 +200,10 @@ Third version - a field is added
</message>
</messageSchema>
```

Notice field addition effects only the version of the field: We don't update
`sinceVersion` on a message when we add a field to it.

*Note:* `sinceVersion` is not required, and has no default interpretation. In
other words, "FIX Binary Message1" cannot be assumed as since version zero. To
clarify this, consider adding `sinceVersion` on initial schema elements.