Skip to content

Commit

Permalink
More fixes and clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
afflerbach committed Sep 3, 2019
1 parent b335a25 commit 76d4460
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cookbook/builtin-mocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ Such a mock response always identifies itself with a `Mock: true` response heade

A fitting mock response body will be picked from the `examples` section according to the submitted `Accept` header – with `application/json` being the default.

Mock responses will be validated, if response validation is enabled in `config.xml`.
Mock responses will be validated, if [response validation](/reference/OpenAPI/validation.md) is enabled in `swagger.yaml`.
23 changes: 12 additions & 11 deletions tutorial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@ Let's try to start FLAT:

```bash
$ flat start ~/hello-world

No FLAT app found in ~/hello-world: create swagger.yaml to start
```

Before we can start FLAT, we need an API definition. The default location is `./swagger.yaml`. To get the server up and running, an empty one will do the job:
```bash
$ cd ~/hello-world
$ touch swagger.yaml
$ touch ~/hello-world/swagger.yaml
```

Now you can start FLAT like this
Expand Down Expand Up @@ -97,7 +95,7 @@ Object required
Looks like an empty definition isn't really useful.
We will need at least a minimal [OpenAPI definition](https://swagger.io/docs/specification/2-0/basic-structure/)
to get rid of that error page.
in our `swagger.yaml` to get rid of that error page.
Currently, FLAT supports OpenAPI 2.0 also known as Swagger:
Expand Down Expand Up @@ -125,8 +123,8 @@ We'll get rid of it in the next section.
## In the Flow
The [_Flow_](../reference/flow.md) feature of FLAT gives us full control over request and response processing.
Let's create a simple Flow definition in `hello.xml` with an
The [_flow_](../reference/flow.md) feature of FLAT gives us full control over request and response processing.
Let's create a simple flow definition in `hello.xml` with an
[`echo` _action_](../reference/actions/echo.md) that produces a JSON snippet:
```xml
Expand Down Expand Up @@ -193,7 +191,7 @@ In the flow, path parameters can be accessed via `$request/params/…`. With the
</flow>
```
![FLAT error](images/hello-css.png)
!["Hello World" in CSS](images/hello-css.png)
Did you notice how we change the HTTP status code to 404 when the requested
language is unsupported?
Expand Down Expand Up @@ -972,7 +970,7 @@ Besides the built-in debug information, custom debug output can help understand
Here are the complete configuration files:
## `hello.xml`
### `hello.xml`
```xml
<flow>
Expand All @@ -999,7 +997,7 @@ Here are the complete configuration files:
</flow>
```
## `upstream_request.xml`
### `upstream_request.xml`
```xml
<flow>
Expand All @@ -1026,13 +1024,16 @@ Here are the complete configuration files:
</flow>
```
## `swagger.yaml`
### `swagger.yaml`
```yaml
swagger: "2.0"
info:
version: "1.0"
title: Hello World!
x-flat-validate:
request: true
response: true
paths:
/{language}:
get:
Expand All @@ -1058,7 +1059,7 @@ paths:
pattern: ^https://raw.githubusercontent.com/
```
## `upstream.yaml`
### `upstream.yaml`
```yaml
swagger: "2.0"
Expand Down
Binary file modified tutorial/images/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 76d4460

Please sign in to comment.