Compare commits

..

2 Commits

Author SHA1 Message Date
Robert Wallach
5ad421b83e Update publishing.md 2018-03-16 11:45:42 -05:00
Robert Wallach
62e52154ff Update publishing.md 2018-03-06 14:24:47 -06:00
18 changed files with 111 additions and 259 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,32 +1 @@
# 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,8 +24,7 @@ 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)
<!-- theme: info -->
>Did you know? After creating a new page; a header link will automatically be generated
<callout> 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

@@ -1 +1,32 @@
# Publishing
## What
Publishing your documentation has never been easier. Stoplight has added:
- New **Integrations** for Segment, Intercom, and Google Analytics to allow for traffic monitoring and additional analytics
- New **Authorizations** to make sure your documentation is secure at all times. This includes basic user/password authentication and SSO provider integration, powered by Auth0, SAML, and more.
- New **Builds** section for tracking published Hubs, including when a Hub was published, who published it, and under what domain.
Take that Gutenberg!
## Who
- **Organization Owners**, **Account Owners**, and **Administrators** can publish Hubs
## How
1. From the Stoplight editor, click on **Publish** in the far left-hand toolbar
2. Input a **subdomain** under Stoplight's tech-docs.io domain
- Or input a **custom domain** (optional)
3. Once completed, click **Next ->**
4. Select the Hub you wish to publish under **Hub File**
5. Add Integrations to **Segment**, **Intercom**, and **Google Analytics** under Integrations (optional)
6. Add security via **Username/Passwords Login**, **Auth0**, or **SAML** (optional)
7. Once completed, click **Publish** in the top left
8. A confirmation window will ask you to confirm your selection, click **Okay**
9. Once confirmed, **Build Logs** will display your current progress
- The process usually takes 2-5 minutes
10. Once the process has completed, a **green success message** will display at the bottom of the screen, letting you know that the Hub was published succesfully
11. Once a Hub is published, it will appear under **Builds**
12. To unpublish a Hub, select **Unpublish** in the **Danger Zone** underneath **Builds**
- If you wish to delete all builds and release the domain you are currently using, select **Remove Domain**

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
<!-- theme: info -->
>Friendly URLs are links that are easily readable, rememberable, and relevant to the content.
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)
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
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
### 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,9 +5,6 @@
## 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
@@ -27,6 +24,7 @@ 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)
<!-- 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
<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</>

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,32 +1 @@
# 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,75 +1,80 @@
# Running Prism from the Terminal
# Running a Scenario from 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:_
```bash
*On macOs or Linux:*
```
curl https://raw.githubusercontent.com/stoplightio/prism/2.x/install.sh | sh
```
<!-- theme: info -->
> When installed through the installation script, Prism will be installed to `/usr/local/bin/prism`
_On Windows:_
*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) from your CLI and see the Prism help text.
After installing, you should be able to run `prism -h` (or `prism.exe -h` in Windows) and see some 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.
<!-- FIXME: image showing "Run from Terminal" option under a scenario -->
![](http://i.imgur.com/mqpNanE.png)
## Running Scenarios
## Running Local Files
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:
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:
```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"
```
For more information on Scenarios and how they can be used, see [here](./scenarios-introduction.md).
## Including Specs For Contract Testing
## 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:
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:
```bash
prism validate --spec /path/to/my/spec.json
prism conduct myOrg/scenarios/myScenarios --spec /path/to/my/swagger.json
```
You can also run a contract test against a specific upstream URL with the
`--upstream` argument.
## Continuous integration
```bash
prism validate --spec /path/to/my/spec.json --upstream http://localhost:8080
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
```
For more information on contract testing and how it can be used, see [here](./contract-testing.md).
## Related
Then override the default test command for circle in your config.
* [Scenarios Overview](./scenarios-introduction.md)
* [Contract Testing Overview](./contract-testing.md)
* [Integrating Prism into a CI Pipeline](./continuous-integration.md)
``` 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.

View File

@@ -1,120 +1 @@
# 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.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB