{"size": 1321, "ext": "scrbl", "max_stars_repo_path": "scribblings/language.scrbl", "max_stars_repo_name": "jessealama/riposte", "max_stars_repo_stars_event_min_datetime": "2018-11-08T19:12:04.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-11T16:09:15.000Z", "max_issues_repo_path": "scribblings/language.scrbl", "max_issues_repo_name": "jessealama/riposte", "max_issues_repo_issues_event_min_datetime": "2018-10-25T08:57:28.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-12T12:38:06.000Z", "max_forks_repo_path": "scribblings/language.scrbl", "max_forks_repo_name": "jessealama/riposte", "max_forks_repo_forks_event_min_datetime": "2018-11-15T08:33:59.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-05T21:07:15.000Z"}
{"max_stars_count": 37, "max_issues_count": 12, "max_forks_count": 5, "avg_line_length": 33.8717948718, "max_line_length": 564, "alphanum_fraction": 0.7441332324}
#lang scribble/manual

@title{Language}

The Riposte language consists of three basic elements:

@itemlist[
  @item{@emph{assignments},}

  @item{@emph{imports},}

  @item{@emph{commands}, and}

  @item{@emph{assertions}}

]

Here's a simple Riposte script contains all three ingredients:

@codeblock[#:keep-lang-line? #f]|{
#lang riposte
^Content-Type := "application/json"
$payload := { "a": 5, "b": [] }
POST $payload to https://whatever.test responds with 201
/foo is a positive integer
}|

Lines 1 and 2 are assignments; the first assigns a value to a header, and the second assigns a value to a variable. Line 3 is a command: here, we send a @tt{POST} request, with a payload—a JSON object specified in line 2. We expect that the response we receive has an exit code of 201. Line 4 is an assertion. We're saying there that the response body had better be well-formed JSON, that that JSON had better be a JSON object, and that that object had better have the property @tt{foo}, and the value of the @tt{foo} property of that object is a positive integer.

The following sections give a more thorough discussion of the different kinds of top-level syntatic ingredients.

@include-section["import.scrbl"]

@include-section["assignments.scrbl"]

@include-section["commands.scrbl"]

@include-section["assertions.scrbl"]
