Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pact V3 Tracking Issue #318

Open
YOU54F opened this issue Aug 12, 2024 · 0 comments
Open

Pact V3 Tracking Issue #318

YOU54F opened this issue Aug 12, 2024 · 0 comments

Comments

@YOU54F
Copy link
Member

YOU54F commented Aug 12, 2024

We would like to implement Pact V3 Specification support for Pact Ruby

Current status

  • Initial 3.0.0 support for asynchronous message pact via pact-message-ruby
  • Initial support for providerStates
    • ⚠️ Currently only supports the first providerStates array entry
    • ⚠️ Currently does not support providerStates params

Required V3 Features

Implementation notes

  • Strong consideration should be made for incorporating pact_ffi functionality (see Pact FFI Tracking Issue #317) rather than re-implementing in ruby

Validation

V3 Related Issues

Will be tagging and closing related v3/v4 issues, and linking to this meta issue

V3 Generators

Generator Attributes Description Example JSON
RandomInt min, max Generates a random integer value between min and max values { "type": "RandomInt", "min": 0, "max": 2147483647 }
RandomDecimal digits Generates a random decimal value (BigDecimal) with the provided number of digits { "type": "RandomDecimal", "digits": 6 }
RandomHexadecimal digits Generates a random hexadecimal value (String) with the provided number of digits { "type": "RandomHexadecimal", "digits": 8 }
RandomString size Generates a random string value of the provided size characters { "type": "RandomString", "size": 20 }
Regex regex Generates a random string value from the provided regular expression { "type": "Regex", "regex": "\\d{1,8}" }
Uuid Generates a random UUID value (simple format) { "type": "Uuid" }
Date format (Optional) Generates a Date value from the current date either in ISO format or using the provided format string { "type": "Date", "format": "MM/dd/yyyy" }
Time format (Optional) Generates a Time value from the current time either in ISO format or using the provided format string { "type": "Time", "format": "HH:mm" }
DateTime format (Optional) Generates a Date and Time (timestamp) value from the current date and time either in ISO format or using the provided format string { "type": "DateTime", "format": "yyyy/MM/dd - HH:mm:ss.S" }
Boolean Generates a random boolean value { "type": "RandomBoolean" }

V3 Matchers

matcher Spec Version example configuration description
Include V3 { "match": "include", "value": "substr" } This checks if the string representation of a value contains the substring.
Integer V3 { "match": "integer" } This checks if the type of the value is an integer.
Decimal V3 { "match": "decimal" } This checks if the type of the value is a number with decimal places.
Number V3 { "match": "number" } This checks if the type of the value is a number.
Timestamp V3 { "match": "datetime", "format": "yyyy-MM-dd HH:ss:mm" } Matches the string representation of a value against the datetime format
Time V3 { "match": "time", "format": "HH:ss:mm" } Matches the string representation of a value against the time format
Date V3 { "match": "date", "format": "yyyy-MM-dd" } Matches the string representation of a value against the date format
Null V3 { "match": "null" } Match if the value is a null value (this is content specific, for JSON will match a JSON null)
Boolean V3 { "match": "boolean" } Match if the value is a boolean value (booleans and the string values true and false)
ContentType V3 { "match": "contentType", "value": "image/jpeg" } Match binary data by its content type (magic file check)
Values V3 { "match": "values" } Match the values in a map, ignoring the keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant