Compare commits

...

19 Commits

Author SHA1 Message Date
Robert Wallach
33bd455225 Update modeling-introduction.md 2018-03-15 15:02:43 -05:00
Robert Wallach
a3e8aec504 Update modeling-introduction.md 2018-03-15 15:01:13 -05:00
Robert Wallach
be7e72b355 Update duplication-refs.md 2018-03-15 14:34:30 -05:00
Robert Wallach
facff9dbba Update subpages.md 2018-03-15 14:30:20 -05:00
Robert Wallach
73c4a8fd86 Update routing.md 2018-03-15 14:24:43 -05:00
Robert Wallach
1417ad2278 Update routing.md 2018-03-15 14:21:56 -05:00
Robert Wallach
1871b9744d Update pages.md 2018-03-15 14:18:50 -05:00
Robert Wallach
81b359ed20 Update what-is-stoplight.md 2018-03-15 14:11:55 -05:00
Robert Wallach
ec7403fccc Update sign-in.md 2018-03-15 13:45:51 -05:00
Robert Wallach
dcb7c8391c Update manage-password.md 2018-03-15 13:44:59 -05:00
Robert Wallach
8033d3ce19 Update edit-profile.md 2018-03-15 13:43:36 -05:00
Robert Wallach
619d23dab1 Update changing-your-username.md 2018-03-15 13:41:59 -05:00
Robert Wallach
f793b695d6 Update changing-your-email.md 2018-03-15 13:40:39 -05:00
Ross McDonald
26554c026d Merge pull request #149 from stoplightio/feature/view-history-changes
Add Viewing Changes article
2018-03-13 19:38:35 +00:00
Ross McDonald
1c17bf6e19 Proposed updates to Terminal Testing article (#145)
* Proposed updates for run-test-terminal article

* Update run-test-terminal.md

* Add example showing running scenario from URL. Add callout showing where the prism binary will be installed to.
2018-03-06 14:28:36 -06:00
Ross McDonald
aaf2cfe2fe Add Running Tests by URL Article (#150)
* Add first pass at run-test-url article.

* Update run-test-url.md

* Update run-test-url.md

* Edits
2018-03-06 14:27:08 -06:00
Robert Wallach
a708f52d3c Update view-history-changes.md 2018-02-22 15:06:02 -06:00
Ross McDonald
479fa10722 Minor updates 2018-02-22 14:04:11 -06:00
Ross McDonald
7a49103b10 First pass at viewing changes 2018-02-22 13:58:18 -06:00
17 changed files with 259 additions and 80 deletions

View File

@@ -7,7 +7,7 @@ Changing your email address is easy as pie
## How
1. Click on your **username** in the top right
2. Click on the **Account** button.
2. Click on the **Account** button
3. In the **Basic Info** section, replace the email listed with one you would like to change to
4. Click **Save** and youre all done

View File

@@ -8,5 +8,5 @@ You can change your username at any time
## How
1. Click on your current **username** in the top right
2. Click on **Account**
3. Under **Basic Info** input a new username
3. Under **Basic Info**, input a new username
4. Click **Save**

View File

@@ -3,18 +3,18 @@
![](../../assets/gifs/account-info.gif)
## What
* In your profile you can edit things like:
* Basic Info
* Username
* Name
* Email
* Upload a profile image
* Change Password
In your profile you can edit things like:
* Basic Info
* Username
* Name
* Email
* Upload a profile image
* Change Password
## How
1. Select your **Username** in the top right corner
2. Click **Account**
3. Make your edits in **Basic Info** then click **Save**
3. Make your edits in **Basic Info**, then click **Save**
* You can also click **Reset** if you would like to start from scratch
4. Upload a profile image
5. Make your edits in Change Password then click **Change Password**

View File

@@ -3,10 +3,10 @@
![](../../assets/gifs/account-info.gif)
## What
* If youve forgotten the password you use to sign in to Stoplight; you can easily reset it at any time
If youve forgotten the password you use to sign in to Stoplight; you can easily reset it at any time
## What
1. At the login page select **Forgot Password?**
1. At the login page, select **Forgot Password?**
2. Input your email in the space provided
3. Click **Send Email Link**
4. An email will be sent with a link to your email address

View File

@@ -1,9 +1,9 @@
# Sign In To Stoplight
## What
* There are two separate options for creating your snazzy new Stoplight account:
* Login with GitHub
* Create a new account
There are two separate options for creating your snazzy new Stoplight account:
* Login with GitHub
* Create a new account
## How

View File

@@ -1 +1,32 @@
# Viewing Changes
As more users edit files within the same project, tracking changes over time
becomes increasingly difficult. To mitigate these effects, Stoplight provides the full history of changes, which allows you to view and track any changes made.
To see the history of changes for a project, use the 'History' button on the
navigation bar to the left of the project window (shown below). When the history
is being viewed, you will see a series of changes for the project, listed in
descending order by date.
![](../../assets/images/viewing-changes2.png)
Each change event includes:
* The date when the change was made
* The user who made the change
* The files updated by the change
* The differences (known as the 'diff') between each file before and after the
change occurred
See the image below for an overview of the contents of the change view.
![](../../assets/images/viewing-changes.png)
---
**Related**
* [Working with Files](./working-with-files.md)

View File

@@ -29,8 +29,8 @@ Stoplight provides a complete mock server for every API described in the app. Ru
Spinning up your own mock server is as simple as:
# install prism on macOS
### install prism on macOS
curl https://raw.githubusercontent.com/stoplightio/prism/master/install.sh | sh
# run a fake petstore api on http://localhost:4010
### run a fake petstore api on http://localhost:4010
prism run --mock --list --spec http://petstore.swagger.io/v2/swagger.json

View File

@@ -24,7 +24,8 @@ Pages are the macro level building blocks of a Hub. They function as the canvas
2. Input a **Page Route** (optional)
3. **Power the Page** with an External Data Source (optional)
<callout> Did you know? After creating a new page; a header link will automatically be generated </>
<!-- theme: info -->
>Did you know? After creating a new page; a header link will automatically be generated
<callout> To add content to a page you must add a subpage or a content block </>

View File

@@ -12,26 +12,26 @@ Stoplights Hubs features an easy to use routing system to make sure your docs
- Headers + Footers (link)
- Links
<callout>Tips for Friendly URLs
Friendly URLs are links that are easily readable, rememberable, and relevant to the content.
<!-- theme: info -->
>Friendly URLs are links that are easily readable, rememberable, and relevant to the content.
Take a look at the URL for this page. Instead of something like https://help.stoplight.io/docs/fnIenof/123, it is https://help.stoplight.io/docs/hosted-documentation/create-friendly-urls, which is much nicer. </>
## How
### Pages & Subpages
1. Select the Hub you wish to modify
2. Add a new page or subpage (link)
a. Select a page title to auto-fill the Page Route or
b. Input a custom page route
3. Select an existing page or subpage
4. Select the gear icon at the top of the Hub in the center of the page or subpage you wish to modify
a. Input a new URL under Page Route
1. Select the **Hub** you wish to modify
2. Add a new **page** or **subpage** (link)
1. Select a **page title** to auto-fill the **Page Route** or
2. Input a **custom page route**
3. Select an **existing page** or **subpage**
4. Select the **gear icon** at the top of the Hub in the center of the page or subpage you wish to modify
1. Input a **new UR**L under Page Route
### Headers & Footers
1. Select the Hub you wish to modify
2. Add a new header or footer (link) or
3. Hover over an existing header or footer and click the gear icon
a. Input a Path to Page or image URL
1. Select the **Hub** you wish to modify
2. Add a new **header or footer** (link) or
3. Hover over an existing header or footer and click the **gear icon**
a. Input a **Path to Page** or **image URL**

View File

@@ -5,6 +5,9 @@
## What
Subpages are the second tier macro building blocks of Hubs. They function as a canvas for blocks. They are commonly used to house content based on a specific topic. Subpages can have more subpages nested underneath them, which gives you lots of flexibility to organize your Hub as you see fit. If a subpage has subpages nested inside of it, it will be displayed as a collapsible group in the left sidebar.
<!-- theme: info -->
>Subpages populate the navigational sidebar of a page.
### Hubs Architecture Top Down
- Pages
- Subpages
@@ -24,7 +27,6 @@ Subpages are the second tier macro building blocks of Hubs. They function as a c
3. Give the Subpage a **Sidebar Token** (optional)
4. **Power the Subpage** with an External Data Source (optional)
<callout> Subpages populate the navigational sidebar of a page. </>
<callout> Just like pages, subpages can have blocks. Any blocks added to a subpage will be displayed when a reader navigates to that subpage in your hub</>
<!-- theme: info -->
>Just like pages, subpages can have blocks. Any blocks added to a subpage will be displayed when a reader navigates to that subpage in your hub

View File

@@ -7,7 +7,7 @@
- Similar features can be created as reusable definitions and utilized with references
- These definitions can be hosted on the same server as your OAS file or on a different server
- You can reference a definition hosted at any location or server
- Apart from defining reusable definitions, you can also define reusable responses and parameters. You can store your reusable definitions, responses, and parameters in a common library.
- Apart from defining reusable definitions, you can also define reusable responses and parameters. You can store your reusable definitions, responses, and parameters in a common library
<!-- theme: info -->
>Key Terms: A definition is a named schema object. A reference is a path to a declaration within an OAS file.

View File

@@ -1 +1,32 @@
# Modeling Introduction
![video/gif]()
## What is API Design?
Designing (also known as Modeling) your API involves describing all of the inputs and outputs across the footprint of your entire service. Your API design will answer questions like:
- What are the different resources and operations available in your API?
- How does your API authenticate requests?
- What are the different data models assoicated with your service?
- How does your API handle errors?
## How does it fit into Stoplight?
The Stoplight design module is where you and your team will maintain the single source of truth that describes the inputs and outputs of your API.
Once you have your API described in the Stoplight design module, you can:
- Publish all or part of your API in our Documentation service
- Create API tests from your designs
- Send requests to your API to debug it
- ...and much more
## Getting Started
There are a few ways to get started designing your API with the Stoplight design module, depending on how developed your API is:
- Create an API from scratch [Using the CRUD Builder]()
- [Reference another API Spec]()
- [Send HTTP Requests]() to an existing API Spec
- [Validate your API Spec]()

View File

@@ -1,80 +1,75 @@
# Running a Scenario from Terminal
# Running Prism from the Terminal
It is very easy to run scenario collections, or individual scenarios, on your own computer, completely outside of the Scenarios app.
First, install Prism, our command line tool for running scenarios.
*On macOs or Linux:*
```
_On macOS or Linux:_
```bash
curl https://raw.githubusercontent.com/stoplightio/prism/2.x/install.sh | sh
```
*On Windows:*
<!-- theme: info -->
> When installed through the installation script, Prism will be installed to `/usr/local/bin/prism`
_On Windows:_
```
Download from https://github.com/stoplightio/prism/tree/2.x
```
After installing, you should be able to run `prism -h` (or `prism.exe -h` in Windows) and see some help text.
After installing, you should be able to run `prism -h` (or `prism.exe -h` in Windows) from your CLI and see the Prism help text.
The Scenario app has a convenient display that gives you the exact command required to run the collection or scenario that you are viewing, taking into account your current environment variables. If you have the Scenario editor connected to a local file on your computer, it will use the path to that file, otherwise it will use the Scenario SRN (unique identifier).
The Scenario app has a convenient display that gives you the exact command required to run the collection or scenario that you are viewing (taking into account your current environment variables). If you have the Scenario editor connected to a local file on your computer, it will use the path to that file, otherwise it will use the Scenario SRN (unique identifier).
<!-- theme: warning -->
> Keep in mind that if you are storing your Scenarios on Stoplight's servers, and running them from the command line, you must save them in the Stoplight app before running! This is because Prism will make a call to the Stoplight API to fetch your Scenario JSON, which it will then run from your computer.
See below for a screenshot of the "Run From Terminal" command generator. The command in this box will update live in response to environment, user, and scenario changes.
![](http://i.imgur.com/mqpNanE.png)
<!-- FIXME: image showing "Run from Terminal" option under a scenario -->
## Running Local Files
## Running Scenarios
The `prism conduct` command accepts a filepath. So, if you are working with [local scenario collection](#docTextSection:Ap4Z2B7RgbbLFLjJD) .json files, you can run them with something like:
To run a local Scenario, you can use the `prism conduct` command. The `conduct`
command accepts either a local file path or URL. If you are working with a local
Scenario `collection.json` file, you can run the Scenario using the following
command:
```bash
# Run a local scenario
prism conduct /path/to/collection.json
# Run a remote scenario by URL
prism conduct "https://export.stoplight.io/1234/master/main.scenarios.yml"
```
## Including Specs For Contract Testing
For more information on Scenarios and how they can be used, see [here](./scenarios-introduction.md).
If you are using [contract testing](#docTextSection:tFWniZdshJYLLtKms), you will need to include the filepath to the API specification as part of the command. This is what that looks like:
## Contract Testing
To use Prism for contract testing (or API validation), you can use the `prism validate` command.
The `validate` command takes a `--spec` argument, which is either a file path or URL to an OpenAPI specification file.
To run a contract test against the default API URL set in the specification, use the command:
```bash
prism conduct myOrg/scenarios/myScenarios --spec /path/to/my/swagger.json
prism validate --spec /path/to/my/spec.json
```
## Continuous integration
You can also run a contract test against a specific upstream URL with the
`--upstream` argument.
Most CI products (Circle CI, Travis, Jenkins, Codship, etc) generally function in the same way: setup environment, invoke commands to run tests. With Scenarios + Prism, the process is similar. Install Prism, and then configure the CI process to run the appropriate Prism command. We've included instructions for Circle CI below, but these concepts should loosely apply to other CI products.
#### Circle CI
Integrating [Prism](http://stoplight.io/platform/prism) into Circle CI is easy. All you need to do is install Prism and overide the test command.
To install Prism just add a dependency to your circle config.
``` yaml
dependencies:
pre:
- curl https://raw.githubusercontent.com/stoplightio/prism/2.x/install.sh | sh
```bash
prism validate --spec /path/to/my/spec.json --upstream http://localhost:8080
```
For more information on contract testing and how it can be used, see [here](./contract-testing.md).
Then override the default test command for circle in your config.
## Related
``` yaml
test:
override:
- prism conduct orgId/scenarios/scenarioId
```
When running `prism conduct` you can:
- Use the Scenario SRN, as displayed above.
- Include the Scenario JSON on your CI server, and pass in its absolute file path
- Pass in the absolute URL to the scenario JSON served up via HTTP.
<!-- theme: warning -->
> Don't forget to pass in any required environment values with the --env command line flag (or you can provide the filepath to a json file with your environment variables)!
For convenience, you can find the full command to run your scenario collection or individual scenario in the Stoplight app.
* [Scenarios Overview](./scenarios-introduction.md)
* [Contract Testing Overview](./contract-testing.md)
* [Integrating Prism into a CI Pipeline](./continuous-integration.md)

View File

@@ -1 +1,120 @@
# Triggering Scenarios by URL
In addition to being able to run tests [through Stoplight](./run-test-stoplight.md) and [the terminal](./run-test-terminal.md),
scenarios can also be run by issuing a HTTP request.
To trigger a scenario by URL, there are two methods:
* Issuing a HTTP `GET` request, which runs the collection with the project's default
settings and configuration.
* Issuing a HTTP `POST` request, which runs the collection with variables
populated by the request's JSON body. This is necessary if you have passwords
or other sensitive pieces of data that are not stored in Stoplight, but are
required for running the scenario.
## Finding the Scenario URL
Every scenario has a unique URL that can be used to remotely trigger the
scenario. To find this URL:
* Go to the scenario's summary in Stoplight
* Below the scenario summary is a "Trigger This Collection" section
* Within this section is a "Trigger by URL" containing the URL unique to this
scenario
![](../../assets/images/run-test-url.png)
## Triggering Scenarios
If the scenario is part of a public project and does not require any
customization to be run, then it can be triggered by issuing a simple HTTP `GET`
request to the scenario's URL, as shown below.
```bash
$ curl 'https://oihdflk5hiyltnnsxelttmnsw4ylsnfxxgltznvwa.prism.stoplight.io/'
{
"status": "completed",
"failCount": 3,
"passCount": 6,
"time": 555.3748400000001,
"env": {
...
```
To customize the scenario's variables (i.e., to add passwords and other sensitive
information), they can either be included as URL query parameters in the `GET`
request, or included within the request body of a `POST` request.
### Customizing Variables with Query String Parameters
You can customize the variables included in the scenario at runtime by adding
extra [query string parameters](https://en.wikipedia.org/wiki/Query_string) to
the URL.
For example, if you have an `api_token` variable that is required to run your
scenario, it can be added to the scenario by attaching the `?api_token=abc123`
query string to the URL (where `abc123` is the value of the `api_token`
variable).
### Customizing Variables with a HTTP POST Body
In addition to adding a query string parameter, scenario variables can also be
updated by using a HTTP `POST` request instead of a `GET` request. When using
this method, the `POST` body must be composed of JSON with the JSON keys
corresponding to the variables within the scenario.
Similar to the example above, if you have an `api_token` variable that is
required to run your scenario, issuing a HTTP `POST` with the following JSON
body will inject the variable into the scenario runtime.
```json
{
"api_token": "abc123"
}
```
To issue a `POST` request from the CLI, you can use the `curl` command. For
example:
```bash
$ curl -XPOST \
--data-binary '{"api_token":"abc123"}' \
'https://oihdflk5hiyltnnsxelttmnsw4ylsnfxxgltznvwa.prism.stoplight.io/'
{
"status": "completed",
"failCount": 3,
"passCount": 6,
"time": 555.3748400000001,
"env": {
...
```
### Triggering Scenarios in Private Projects
Public project scenarios can be triggered directly through the scenario URL with
no further action needed. Private projects, however, must have an API token
specified so that the request can be authenticated properly. To generate a new
API token for your Stoplight acccount, see
[here](https://next.stoplight.io/profile/access-tokens).
Once you have an API token, set it under the `Private-Token` header in order for
it to be used to authenticate with the Stoplight API. For example:
```bash
$ curl -H 'Private-Token: H4BTDASDf5sGHMWJSfE32' ...
```
<!-- theme: warning -->
> Be sure to keep all private tokens safe! They can be used to authenticate
> requests with any project that your account has access to.
---
**Related**
* [Running Scenarios through Stoplight](./run-test-stoplight.md)
* [Running Scenarios from the Terminal](./run-test-terminal.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB