Skip to content

A small demo showing the integration of OpenAPI and PACT

License

Notifications You must be signed in to change notification settings

trustbit/OpenAPI-Pact-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo for integrating OpenAPI with Pact

This application demos the workflow of a simple OpenAPI specification in combination with Pact.

  • Defining and specifying the OpenAPI Description
  • Generating Consumer Stubs from the specification and defining the first pacts in Consumer
  • Generating Server Stubs, implementing the API and verifying the pacts in Provider
flowchart TD
    OpenAPI{{OpenAPI Specification}} --> |uses C# Client Generator| Consumer(.NET Consumer Application)
    Consumer --> |defines Unit Tests to generate| PF{{Pacts}}
    PF-. stored in File or PactFlow .-> Broker[(Broker)]

    OpenAPI --> |uses C# Server Generator for| Provider(.NET Provider Application)
    Verification --> |runs| Provider
    
    Verification-. uses Pacts from .-> Broker
Loading

Besides storing and exchanging pacts via files an integration via http://pactflow.io is shown.

To integrate with PactFlow register an account and obtain a read/write Token and Host Configuration (e.g. from https://trustbit.pactflow.io/settings/api-tokens)

export PACT_BROKER_BASE_URL="https://trustbit.pactflow.io"
export PACT_BROKER_TOKEN=yourToken

About

A small demo showing the integration of OpenAPI and PACT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages