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 all commits
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
28 changes: 22 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,6 @@ Third version - a field is added
</message>
</messageSchema>
```

Notice adding fields does not effect `sinceVersion` on the message that
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main thing that's happening with this example is we are adding sinceVersion on a field contained by message lacking sinceVersion. I'm not sure if this was intentional design of the example, but it was behind my mind wondering about how helpful it is to know when a field was added, but not know when the message was added.

I can still remove this revision if it is considered distracting or should be on a different PR. let me know which way to go.

contains them.