Skip to content

Commit

Permalink
docs: change hapi name references
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob McGuinness committed Nov 28, 2019
1 parent dce4ef1 commit f6021e8
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Contributions from the community are welcome. Please follow this guide when logg

All issues should be created using the [new issue form](https://github.com/glennjones/hapi-swagger/issues/new).

- Please check the "[Features from HAPI that cannot be ported to Swagger](https://github.com/glennjones/hapi-swagger/blob/master/usageguide.md#features-from-hapi-that-cannot-be-ported-to-swagger])" section of the usage guide.
- Please check the "[Features from Hapi that cannot be ported to Swagger](https://github.com/glennjones/hapi-swagger/blob/master/usageguide.md#features-from-hapi-that-cannot-be-ported-to-swagger])" section of the usage guide.
- Try the plugin option `debug = true` to see if any errors or warning are logged. see [Debugging](https://github.com/glennjones/hapi-swagger/blob/master/usageguide.md#debugging)
- Clearly describe the issue including steps to reproduce it. Also include example code of any `routes` that cause an issue.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ in a project.

## Installation

You can add the module to your HAPI using npm:
You can add the module to your Hapi using npm:

```bash
> npm install hapi-swagger --save
Expand All @@ -40,7 +40,7 @@ content serving.

## Quick start

In your HAPI apps main JavaScript file add the following code to created a HAPI `server` object. You will also add the routes for you API as describe on hapijs.com site.
In your Hapi apps main JavaScript file add the following code to created a Hapi `server` object. You will also add the routes for you API as describe on hapijs.com site.

```Javascript
const Hapi = require('@hapi/hapi');
Expand Down Expand Up @@ -160,4 +160,4 @@ Read the [contributing guidelines](./.github/CONTRIBUTING.md) for details.

## Thanks

I would like to thank all that have contributed to the project over the last couple of years. This is a hard project to maintain, getting HAPI to work with Swagger is like putting a round plug in a square hole. Without the help of others it would not be possible.
I would like to thank all that have contributed to the project over the last couple of years. This is a hard project to maintain, getting Hapi to work with Swagger is like putting a round plug in a square hole. Without the help of others it would not be possible.
2 changes: 1 addition & 1 deletion lib/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ internals.paths.prototype.build = function(routes) {

// hapi wildcard method support
if (routeData.method === '*') {
// OPTIONS not supported by Swagger and HEAD not support by HAPI
// OPTIONS not supported by Swagger and HEAD not support by Hapi
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach(method => {
var newRoute = Hoek.clone(routeData);
newRoute.method = method.toUpperCase();
Expand Down
8 changes: 4 additions & 4 deletions optionsreference.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@
## Route Options

- `validate`
- `params`: (JOI object) allows you to `param` route documentation outside of HAPI validation
- `query`: (JOI object) allows you to `query` route documentation outside of HAPI validation
- `headers`: (JOI object) allows you to `headers` route documentation outside of HAPI validation
- `payload`: (JOI object) allows you to `payload` route documentation outside of HAPI validation
- `params`: (JOI object) allows you to `param` route documentation outside of Hapi validation
- `query`: (JOI object) allows you to `query` route documentation outside of Hapi validation
- `headers`: (JOI object) allows you to `headers` route documentation outside of Hapi validation
- `payload`: (JOI object) allows you to `payload` route documentation outside of Hapi validation

## Examples

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/Integration/builder-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ lab.experiment('builder', () => {
consumes: ['application/x-www-form-urlencoded'],
produces: ['application/json', 'application/xml'],
externalDocs: {
description: 'Find out more about HAPI',
description: 'Find out more about Hapi',
url: 'http://hapijs.com'
},
'x-custom': 'custom'
Expand Down
2 changes: 1 addition & 1 deletion test/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ helper.validateBearer = async (request, token) => {
};

/**
* fires a HAPI reply with json payload - see h2o2 onResponse function signature
* fires a Hapi reply with json payload - see h2o2 onResponse function signature
*
* @param {Object} err
* @param {Object} res
Expand Down
24 changes: 12 additions & 12 deletions usageguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
- [Caching](#caching)
- [File upload](#file-upload)
- [Headers and .unknown()](#headers-and-unknown)
- [Additional HAPI data using x-\*](#additional-hapi-data-using-x-)
- [Additional Hapi data using x-\*](#additional-hapi-data-using-x-)
- [JSON without UI](#json-without-ui)
- [Simplifying the JSON](#simplifying-the-json)
- [Debugging](#debugging)
- [Features from HAPI that cannot be ported to Swagger](#features-from-hapi-that-cannot-be-ported-to-swagger)
- [Features from Hapi that cannot be ported to Swagger](#features-from-hapi-that-cannot-be-ported-to-swagger)

## Links

Expand Down Expand Up @@ -282,7 +282,7 @@ There is a example of this feature [`dot-grouping.js`](examples/dot-grouping.js)

## Response Object

HAPI allow you to define a response object for an API endpoint. The response object is used by HAPI to both validate
Hapi allow you to define a response object for an API endpoint. The response object is used by Hapi to both validate
and describe the output of an API. It uses the same JOI validation objects to describe the input parameters. The
plugin turns these object into visual description and examples in the Swagger UI.

Expand Down Expand Up @@ -409,7 +409,7 @@ options: {
## Caching

It can take some time to create the `swagger.json` data if your server has many complex routes. So `hapi-swagger`
can cache its `swagger.json` data. The cache options are those of HAPI
can cache its `swagger.json` data. The cache options are those of Hapi

```javascript
options.cache: {
Expand Down Expand Up @@ -438,7 +438,7 @@ the three important elements are:

- `payloadType: 'form'` in the plugins section creates a form for upload
- `.meta({ swaggerType: 'file' })` add to the payload property you wish to be file upload
- `payload` configuration how HAPI will process file
- `payload` configuration how Hapi will process file

```javascript
{
Expand Down Expand Up @@ -516,7 +516,7 @@ validate: {
}
```
## Additional HAPI data using `x-*`
## Additional Hapi data using `x-*`
The OpenAPI spec allows for the addition of new properties and structures as long as they their name start with `x-`.
Where possible I have mapped many of Hapi/Joi properties into the swagger.json file.
Expand Down Expand Up @@ -550,13 +550,13 @@ be useful if your are using codegen tools against the JSON
## Debugging
The plugin can validate its output against the OpenAPI(Swagger) specification. You can to this by setting the plugin option `options.debug` to `true`.
The debug output is logged into the HAPI server object. You can view the logs by either install the `Good` plugin or by using `server.on`.
The debug output is logged into the Hapi server object. You can view the logs by either install the `Good` plugin or by using `server.on`.
There is a small example of the [`debug`](examples/debug.js) feature in the examples directory.
## Features from HAPI that cannot be ported to Swagger
## Features from Hapi that cannot be ported to Swagger
Not all the flexibility of HAPI and JOI can to ported over to the Swagger schema. Below is a list of the most common asked for features that cannot be ported.
Not all the flexibility of Hapi and JOI can to ported over to the Swagger schema. Below is a list of the most common asked for features that cannot be ported.
- **`Joi.extend()`** Only works if you are extending a `base` type such as `number` or `string`
- **`Joi.lazy()`** This new `JOI` feature needs more research to see if its possible to visual describe recursive objects before its supported.
Expand Down Expand Up @@ -596,7 +596,7 @@ This will load all routes that have one or more of the given tags (`foo` or `bar
## Example code in project
There are a number of examples of different uses of `hapi-swagger` in the examples directory. These files contain a full HAPI node app:
There are a number of examples of different uses of `hapi-swagger` in the examples directory. These files contain a full Hapi node app:
- [`custom.js`](examples/custom.js) - how build a custom documentation page with its own CSS and JS
- [`debug.js`](examples/debug.js) - how console.log debug information from `hapi-swagger`
Expand All @@ -613,5 +613,5 @@ There are a number of examples of different uses of `hapi-swagger` in the exampl
Both these example use a custom HTML page
- [`be-more-hapi`](https://github.com/glennjones/be-more-hapi) - talk from Async.js on the October 2013 - old `hapi-swagger` example project, but keep update
- [`hapi-token-docs`](https://github.com/glennjones/hapi-token-docs) - A example site using HAPI, JWT tokens and swagger documentation
- [`time-to-be-hapi`](https://github.com/glennjones/time-to-be-hapi) - Londonjs talk March 2016 has many example uses of HAPI and one using `hapi-swagger`
- [`hapi-token-docs`](https://github.com/glennjones/hapi-token-docs) - A example site using Hapi, JWT tokens and swagger documentation
- [`time-to-be-hapi`](https://github.com/glennjones/time-to-be-hapi) - Londonjs talk March 2016 has many example uses of Hapi and one using `hapi-swagger`

0 comments on commit f6021e8

Please sign in to comment.