#pact #testing #cdc #file-format #read-write

pact_models

Pact-Rust support library that provides the core models for dealing with Pact files

68 releases (31 stable)

new 1.2.0 Apr 23, 2024
1.1.18 Feb 6, 2024
1.1.17 Jan 24, 2024
1.1.12 Nov 13, 2023
0.1.0 Jul 23, 2021

#197 in Parser implementations

Download history 1117/week @ 2024-01-03 1432/week @ 2024-01-10 1816/week @ 2024-01-17 2544/week @ 2024-01-24 1391/week @ 2024-01-31 1712/week @ 2024-02-07 1206/week @ 2024-02-14 1925/week @ 2024-02-21 1101/week @ 2024-02-28 1147/week @ 2024-03-06 2154/week @ 2024-03-13 1576/week @ 2024-03-20 853/week @ 2024-03-27 1154/week @ 2024-04-03 1398/week @ 2024-04-10 940/week @ 2024-04-17

4,502 downloads per month
Used in 16 crates (14 directly)

MIT license

1MB
22K SLoC

Pact Models

This library provides the core models for dealing with Pact files. It supports the V3 pact specification and V4 pact specification.

Online rust docs

Reading and writing Pact files

The Pact struct has methods to read and write pact JSON files. It supports all the specification versions up to V4, but will convert a V1, V1.1 and V2 spec file to a V3 format.

Crate features

All features are enabled by default

  • datetime: Enables support of date and time expressions and generators. This will add the chronos crate as a dependency.
  • xml: Enables support for parsing XML documents. This feature will add the sxd-document crate as a dependency.

lib.rs:

The pact_models crate provides all the structs and traits required to model a Pact.

Crate features

All features are enabled by default

  • datetime: Enables support of date and time expressions and generators. This will add the chronos crate as a dependency.
  • xml: Enables support for parsing XML documents. This feature will add the sxd-document crate as a dependency.

Dependencies

~9–25MB
~321K SLoC