Skip to content

coffeejson-swift 1.1.1

Choose a tag to compare

@ken0nek ken0nek released this 04 Dec 07:05
· 16 commits to main since this release

Reads and writes CoffeeJSON 1.1, and follows the spec where decoding, units
and the schema validator diverged from it.

Fixed

  • ImportedTasting.extractionYieldPercent no longer uses the recipe's target
    yield when the tasting carries a measured yield it cannot read as one mass,
    a window or an unrecognized unit. It derives nothing instead, because the
    spec takes the beverage mass from the tasting whenever it carries one.
  • Codec.decodeDocument applies the version gate before it decodes any
    collection. A document of another major now reports .unsupportedVersion
    even when its recipes, beans or tastings have a shape this major does not
    read, where it used to report a field of that shape.
  • A recipe whose water carries a unit the package does not recognize reads
    as stating no water, as the spec requires. It imports through ratio when
    it states one and otherwise fails with .missingRequiredField("water").
    It used to import with waterStatedByVolume set and no volume.
  • SchemaValidator asserts format: uri, as the format's own harness does.
    A url or based_on that is not a URI now fails the gate, where it used to
    pass it. The fixture corpus rejects four documents on that keyword alone.
  • An ounce converts to grams at the format's 28.349523125 g, where it used
    Foundation's 28.3495 g. A recipe stated as 1 oz to 15 oz now has a ratio of
    exactly 15. KnownMassUnit.foundationUnit still names Foundation's ounce.

Changed

  • The doc comment on Party.role says a role may appear on any credit, an
    author or a roaster as well as a producer. It said a role was absent on
    those two.

  • ImportError.Kind.allCases lists the twelve kinds in the order of the
    format's error table, with .notAURL and .notHTTP last. They were first.