Repository navigation
coffeejson-swift 2.0.0
Reads and writes CoffeeJSON 1.1. The major is this package's API: the
coffeejson wire version it reads and writes is unchanged.
Changed
-
Breaking. A pour step keeps the dimension its
to_waterwas stated in.
ImportedPourStep.cumulativeWaterGrams: Doubleis replaced by
cumulativeWater: WaterTarget, an enum with.grams(Double)for a mass
(gram, orouncein canonical grams) and.milliliters(Double)for a
volume. A step withat_sand ato_waterinmilliliteris now a timed
pour. It was a read-only step with its water gone, though the spec says a
consumer must schedule water off that pair. A windowed volume schedules on
its midpoint and setsDerivedQuantities.steps, as a windowed mass does.
To migrate, read the case where you read grams, and decide what a volume
step means to you:// Before let grams = step.cumulativeWaterGrams ImportedPourStep(atSeconds: 0, cumulativeWaterGrams: 30) // After guard case .grams(let grams) = step.cumulativeWater else { // a volume: convert by your own model and show it as converted, or skip return } ImportedPourStep(atSeconds: 0, cumulativeWater: .grams(30))
-
Breaking.
Bean.roastAgtronandImportedBean.roastAgtronare
Double?. They wereInt?, so a bean stating a valid fractional Agtron
number such as62.5, which the schema allows, failed to import. A reader
that formats the value for display chooses its own number of decimals. -
GearLabelsfollows the registry's corrected ids and labels. An id that
1.1.1 carried and the registry renamed, such astimemore-c3, still
resolves as an alias, under the new label.toddyandwafo-basketare
gone, because neither names one product.Gear.displayLabel(using:)treats
them as unregistered ids.
Fixed
- A share link whose payload a mail client, chat app or text recognition
wrapped now imports.ShareLinkremoves ASCII whitespace (space, tab, line
feed, form feed, carriage return) from thedvalue before it decodes, and
ignores trailing=padding. It already read the standard Base64 alphabet.
Any other character in the payload is still.malformedBase64. The format's
scan vectorsstandard-alphabet,whitespace-in-payload,over-paddedand
stray-characterpin the rule, and the package runs them.
Added
GearLabelscarries 180 more entries that the gear registry now lists,
among them ten scales and nine kettles. No recipe member takes a
scale or a kettle, so this adds their labels and no API.- The test suite runs the format's two blank-title fixtures. The import
rejects a recipe whosetitleis whitespace alone, as it did, and
SchemaValidatorrejects both the blank recipe title and the blank
localization title through the schema'spattern. The import does not read
localizations, so a document whose only fault is a blank localized title
still imports, with the recipe's own title. - A
NOTICEfile carries the copyright and MIT permission notice of
ajv-formats, whoseuriregular expressionSchemaValidatorcopies. The
package shipped that expression without the notice since 1.1.1.