Skip to content

Commit ea67126

Browse files
committed
Update the migration guide
1 parent fb1d55f commit ea67126

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

documentation/v3_migration_guide.md

+16
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,25 @@ When a `JSONSchema` only has one `allowedValue`, it will now be encoded as `cons
163163

164164
The `JSONSchema` type's `coreContext` accessor now gives a non-optional value because all cases have a `CoreContext`. The compiler will let you know where you need to stop handling it as Optional.
165165

166+
#### JSONSchema StringFormat differences
167+
There is no longer `.extended` formats for `.string` JSON Schemas. Instead, all existing `.extended` formats are now just regular .`string` formats (e.g. you can just replace `.extended(.uuid)` with `.uuid`).
168+
169+
There are no longer `.byte` or `.binary` formats for `.string` JSON Schemas. Instead, use the `contentEncoding`s of `.base64` and `.binary`, respectively.
170+
171+
The `.uriReference` `.extended` JSON Schema `.string` format used to serialize to `uriref` whereas the new `.uriReference` JSON Schema `.string` format serializes to `uri-reference`, per the JSON Schema standard.
172+
166173
#### ContentType differences
167174
`ContentType` changed from an `enum` to a `struct`. Equality checks for all of the previous enum's cases will still work against the new static constructors on the struct, but switch statements will no longer be possible.
168175

176+
The following ContentTypes have been added as builtins (you can use static functions on the `ContentType` type to construct these content types):
177+
- `.avi`
178+
- `.aac`
179+
- `.doc`
180+
- `.docx`
181+
- `.gif`
182+
183+
This also means that if you have previously constructed these media types yourself (e.g. `.other("image/gif")`), those custom types will not compare as equal to the new builtin types. You may find use in comparing the `.rawValue` of such content types instead if you want two content types to be equal as long as their string serializations are the same.
184+
169185
#### Response.StatusCode differences
170186
`Response.StatusCode` changed from an `enum` to a `struct`. For most code, use will not change, but if you switch over any values of this type your code will need to change to switch over the `StatusCode` `value` property instead.
171187

0 commit comments

Comments
 (0)