Skip to content

Commit

Permalink
diagram in docs, thanks in readme (stoplightio#976)
Browse files Browse the repository at this point in the history
* diagram in docs, thanks in readme

* stoplight config

* chore: reformat

* docs: fix link

Co-authored-by: Vincenzo Chianese <vincenz.chianese@icloud.com>
  • Loading branch information
Phil Sturgeon and XVincentX authored Feb 11, 2020
1 parent 3266572 commit 1165bf1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .stoplight.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"formats": {
"openapi": {
"rootDir": "reference"
},
"markdown": {
"rootDir": "docs",
"include": ["**"]
},
"image": {
"rootDir": "assets/images",
"include": ["**"]
},
"json_schema": {
"rootDir": "models"
}
}
}
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,21 @@ see what URLs you have available.

If you are interested in contributing to Prism itself, check out our [contributing docs ⇗][contributing] and [code of conduct ⇗][code_of_conduct] to get started.

## Prism Decision Flow Diagram
## Thanks

In case you're interested in all logical decision we make to figure out the best HTTP response to the specific request, you can consult our [diagram](./packages/http/docs/images/mock-server-dfd.png)
Prism is built on top of lots of excellent packages, and here are a few we'd like to say a special thanks to.

- [ajv](https://www.npmjs.com/package/ajv)
- [faker](https://www.npmjs.com/package/faker)
- [fp-ts](https://www.npmjs.com/package/fp-ts)
- [gavel](https://www.npmjs.com/package/gavel)
- [json-schema-faker](https://www.npmjs.com/package/json-schema-faker)
- [lerna](https://www.npmjs.com/package/lerna)
- [micri](https://www.npmjs.com/package/micri)
- [openapi-sampler](https://www.npmjs.com/package/openapi-sampler)
- [yargs](https://www.npmjs.com/package/yargs)

Check these projects out!

[code_of_conduct]: CODE_OF_CONDUCT.md
[contributing]: CONTRIBUTING.md
Expand Down
6 changes: 6 additions & 0 deletions docs/guides/01-mocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ Prism will try to return meaningful responses based on whatever information it h
The first thing to understand is that the Prism HTTP Server respects [Content Negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation). If your API is a mixture of JSON, XML and form data, you can use `Accept`
and `Content-Type` just like with a real API, and it should work as expected, or fail if you request non-existent types.

### The "Decision Engine"

The response Prism decides to give can be figred out with this decision flow diagram.

![](../../packages/http/docs/images/mock-server-dfd.png)

### Response Examples

If a response has an example, it will be used for the response. If there are multiple examples then they can be selected by name. Let's take a look part of an OpenAPI description, this is an operation with a response that has a 200 OK and multiple examples:
Expand Down

0 comments on commit 1165bf1

Please sign in to comment.