Repository navigation
v5.5.0
A service read from its OpenAPI document is typed as well as one written by
hand, and a browser run leaves nothing behind.
Additions
- A string with cases is an
enum.{"type": "string", "enum": ["prod", "test"]}— what utoipa writes for a Rust enum — was imported as an empty
record, soText("{e.env}")showed[object Object]and drewT20. It is
nowenum Env { prod, test }, whose cases are the strings the server sends.
When a case cannot be written as a name ("operate.flags", a digit first,
true), the schema is aStringwherever it is named. - A value that may be null is
T?, however the document says so.
OpenAPI 3.1's"type": ["string", "null"]wasAny?; it isString?, and
the same holds for numbers, booleans and lists. AoneOf(oranyOf) of
{ "type": "null" }and a$refis that type's?, 3.0's
"nullable": truecounts beside atype, anallOfor a$ref, and a
record or an enum whose own schema allows null isT?wherever it is named. allOfis a record that extends another.[{ "$ref": "…/EnvSummary" }, { "properties": … }]istype ServerDetail = EnvSummary { … }; a second
record it names and every part written in place are fields of its own, and
what the schema around a part requires, the part's fields answer to.- A string's
formatis the language's type for what the server sends.
date-timeis aDateTime,dateaDate,uuidaUuid,emailan
Email,uriaUrl— in a response, and in every record only responses
reach. What the program sends (a parameter, a request body, and every
record one reaches, but for itsreadOnlyfields) keepsString, so a
route parameter or an input's text can still be sent.timestays a
String: JSON Schema's carries an offsetTimedoes not read. - Shared parameters and request bodies are read. A parameter or a body
that is a$refintocomponentswas dropped, so a call passing it was
T10; it is what its$refnames, and a body is required when the document
says so. - Anything else a schema names is the type it reads as. A named
oneOf,
an alias of another schema, or a plain string or number declares nothing,
instead of an empty record whose every field read wasT05.
Fixes
if letand a case's payload are names in their whole block.if let why = e.reason { Row { Pill(why) } }drewV01("nothing in scope declares
why"), and so did.failed(why) { … }in amatch; both are now in scope
however deep the element that reads them.- A button named by the
Textin its block draws noA05.Button { Icon("link") Text("Continue") }— and aTextin a branch, or in a
component the block places — names the button. ATooltip's words, a
custom element's tag and a loneBadgestill do not. wf verifyandwf testleave no browser profile behind. Each run
that started Chrome left its ~150 MB profile in the temporary directory;
where/tmpis memory, a day of test runs filled it and the swap behind it.
Chrome is now started with its background downloads off, asked to close
before it is stopped, and its profile is removed; each browser has a
profile of its own.
Upgrading
A specification's nullable values are now T?, so a read that ignored null
— Text(e.reason.toUpperCase()) — is a T04 where it compiled before;
?., ?? or if let says what to do instead. A response field with a
format is now a DateTime, Url and so on, and a String assigned to one
is T01.
Full Changelog: v5.4.0...v5.5.0