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

Support examples in properties #680

Merged
merged 3 commits into from
Nov 8, 2021

Conversation

leolplex
Copy link
Contributor

@leolplex leolplex commented Nov 5, 2021

Hello @StefH ,

This PR contains the capability to support examples when it is defined in the properties:

"schemas": {
        "Order": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer",
              "format": "int64",
              "example": 10
            },
            "petId": {
              "type": "integer",
              "format": "int64",
              "example": 198772
            },
            "quantity": {
              "type": "integer",
              "format": "int32",
              "example": 7
            },
            "shipDate": {
              "type": "string",
              "format": "date-time"
            },
            "status": {
              "type": "string",
              "description": "Order Status",
              "example": "approved",
              "enum": [
                "placed",
                "approved",
                "delivered"
              ]
            },
            "complete": {
              "type": "boolean"
            }
          },
          "xml": {
            "name": "order"
          }
        },
}

The response looks like this:

 "Response": {
            "StatusCode": 200,
            "BodyAsJson": {
                "id": 10,
                "petId": 198772,
                "quantity": 7,
                "shipDate": "2022-08-09T23:23:26.490-05:00",
                "status": "approved",
                "complete": true
            },
            "Headers": {
                "Content-Type": "application/json"
            }
        }

It could be find in the examples that I uploaded before.

Thank you.

@StefH StefH added the feature label Nov 5, 2021
@StefH
Copy link
Collaborator

StefH commented Nov 5, 2021

Can you merge/rebase master into this branch ?

@leolplex leolplex requested a review from StefH November 6, 2021 17:19
@StefH StefH merged commit d3b2422 into WireMock-Net:master Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants