Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

If you use the [API Platform Distribution](../distribution/), API Platform Admin is already installed, you can skip this installation guide.

Otherwise, all you need to install API Platform Admin is a JavaScript package manager. We recommend [Yarn](https://yarnpkg.com/) ([NPM](https://www.npmjs.com/) is also supported).
Otherwise, all you need to install API Platform Admin is a JavaScript package manager. We recommend [Yarn](https://yarnpkg.com/) ([npm](https://www.npmjs.com/) is also supported).

If you don't have an existing React Application, create one using [Create React App](https://create-react-app.dev/):

Expand Down
2 changes: 1 addition & 1 deletion client-generator/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Create a [Next.js application with express server](https://github.com/zeit/next.

### Installing the Generator Dependencies

Enable Typescript in your next project
Enable TypeScript in your next project

$ yarn add --dev typescript @types/react @types/node

Expand Down
2 changes: 1 addition & 1 deletion client-generator/react-native.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Install

To use this generator you need [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/) (or [NPM](https://www.npmjs.com/)) installed.
To use this generator you need [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/) (or [npm](https://www.npmjs.com/)) installed.
To run the command line tool, we also recommend using [npx](https://www.npmjs.com/package/npx).

Create a React Native application using [Expo CLI](https://docs.expo.io/versions/latest/workflow/expo-cli).
Expand Down
4 changes: 2 additions & 2 deletions client-generator/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ supporting Hydra.

If you use API Platform, jump to the next section!
Alternatively, you can generate a skeleton and install the generator using [npx](https://www.npmjs.com/package/npx).
To use this generator you need [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/) (or [NPM](https://www.npmjs.com/)) installed.
To use this generator you need [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/) (or [npm](https://www.npmjs.com/)) installed.

Bootstrap a React application:

Expand Down Expand Up @@ -92,7 +92,7 @@ ReactDOM.render(
<ConnectedRouter history={history}>
<Switch>
{bookRoutes}
{/* Replace bookRooutes with the name of the resource type */}
{/* Replace bookRoutes with the name of the resource type */}
<Route render={() => <h1>Not Found</h1>} />
</Switch>
</ConnectedRouter>
Expand Down
2 changes: 1 addition & 1 deletion client-generator/typescript.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Typescript Interfaces
# TypeScript Interfaces

The TypeScript Generator allows you to create [TypeScript interfaces](https://www.typescriptlang.org/docs/handbook/interfaces.html) that you can embed in any TypeScript-enabled project (React, Vue.js, Angular..)

Expand Down
2 changes: 1 addition & 1 deletion core/data-persisters.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ classes called **data persisters**. Data persisters receive an instance of the c
the `@ApiResource` annotation). This instance contains data submitted by the client during [the deserialization
process](serialization.md).

A data persister using [Doctrine ORM](http://www.doctrine-project.org/projects/orm.html) is included with the library and
A data persister using [Doctrine ORM](https://www.doctrine-project.org/projects/orm.html) is included with the library and
is enabled by default. It is able to persist and delete objects that are also mapped as [Doctrine entities](https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/basic-mapping.html).
A [Doctrine MongoDB ODM](https://www.doctrine-project.org/projects/mongodb-odm.html) data persister is also included and can be enabled by following the [MongoDB documentation](mongodb.md).

Expand Down
2 changes: 1 addition & 1 deletion core/data-providers.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Data Providers

To retrieve data exposed by the API, API Platform uses classes called **data providers**. A data provider using [Doctrine
ORM](http://www.doctrine-project.org/projects/orm.html) to retrieve data from a database, a data provider using
ORM](https://www.doctrine-project.org/projects/orm.html) to retrieve data from a database, a data provider using
[Doctrine MongoDB ODM](https://www.doctrine-project.org/projects/mongodb-odm.html) to retrieve data from a document
database, and a data provider using [Elasticsearch-PHP](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html)
to retrieve data from an Elasticsearch cluster are included with the library. The first one is enabled by default. These
Expand Down
2 changes: 1 addition & 1 deletion core/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Parchment
}
```

The value of the `sunset` attribute can be any string compatible with [the `\DateTime` constructor](http://php.net/manual/en/datetime.construct.php).
The value of the `sunset` attribute can be any string compatible with [the `\DateTime` constructor](https://www.php.net/manual/en/datetime.construct.php).
It will be automatically converted to a valid HTTP date.

It's also possible to set the `Sunset` header only for a specific [operation](operations.md):
Expand Down
2 changes: 1 addition & 1 deletion core/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Last but not least, to create [Event Sourcing](https://martinfowler.com/eaaDev/E
approach is:

* to persist data in an event store using a Messenger handler or a custom [data persister](data-persisters.md)
* to create projections in standard RDBMS (Postgres, MariaDB...) tables or views
* to create projections in standard RDBMS (PostgreSQL, MariaDB...) tables or views
* to map those projections with read-only Doctrine entity classes **and** to mark those classes with `@ApiResource`

You can then benefit from the built-in Doctrine filters, sorting, pagination, auto-joins and all of [the extension points](extending.md) provided by API Platform.
2 changes: 1 addition & 1 deletion core/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
API Platform comes with a powerful error system. It handles expected (such as faulty JSON documents sent by the
client or validation errors) as well as unexpected errors (PHP exceptions and errors).
API Platform automatically sends the appropriate HTTP status code to the client: `400` for expected errors, `500` for
unexpected ones. It also provides a description of the error in [the Hydra error format](http://www.hydra-cg.com/spec/latest/core/#description-of-http-status-codes-and-errors)
unexpected ones. It also provides a description of the error in [the Hydra error format](https://www.hydra-cg.com/spec/latest/core/#description-of-http-status-codes-and-errors)
or in the format described in the [RFC 7807](https://tools.ietf.org/html/rfc7807), depending of the format selected during the [content negotiation](content-negotiation.md).

## Converting PHP Exceptions to HTTP Errors
Expand Down
2 changes: 1 addition & 1 deletion core/external-vocabularies.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
JSON-LD allows to define classes and properties of your API with open vocabularies such as [Schema.org](https://schema.org)
and [Good Relations](http://www.heppnetz.de/projects/goodrelations/).

API Platform Core provides annotations usable on PHP classes and properties for specifying a related external [IRI](http://en.wikipedia.org/wiki/Internationalized_resource_identifier).
API Platform Core provides annotations usable on PHP classes and properties for specifying a related external [IRI](https://en.wikipedia.org/wiki/Internationalized_resource_identifier).

```php
<?php
Expand Down
2 changes: 1 addition & 1 deletion core/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ The date filter allows to filter a collection by date intervals.

Syntax: `?property[<after|before|strictly_after|strictly_before>]=value`

The value can take any date format supported by the [`\DateTime` constructor](http://php.net/manual/en/datetime.construct.php).
The value can take any date format supported by the [`\DateTime` constructor](https://www.php.net/manual/en/datetime.construct.php).

The `after` and `before` filters will filter including the value whereas `strictly_after` and `strictly_before` will filter excluding the value.

Expand Down
2 changes: 1 addition & 1 deletion core/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

If you are starting a new project, the easiest way to get API Platform up is to install the [API Platform Distribution](../distribution/index.md).
It comes with the API Platform Core library integrated with [the Symfony framework](https://symfony.com), [the schema generator](../schema-generator/),
[Doctrine ORM](http://www.doctrine-project.org), [Elasticsearch-PHP](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html),
[Doctrine ORM](https://www.doctrine-project.org), [Elasticsearch-PHP](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html),
[NelmioCorsBundle](https://github.com/nelmio/NelmioCorsBundle) and [Behat](http://behat.org).
[Doctrine MongoDB ODM](https://www.doctrine-project.org/projects/mongodb-odm.html) can also be enabled by following the [MongoDB documentation](mongodb.md).
Basically, it is a Symfony edition packaged with the best tools to develop a REST API and sensible default settings.
Expand Down
2 changes: 1 addition & 1 deletion core/graphql.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GraphQL Support

[GraphQL](http://graphql.org/) is a query language made to communicate with an API and therefore is an alternative to REST.
[GraphQL](https://graphql.org/) is a query language made to communicate with an API and therefore is an alternative to REST.

It has some advantages compared to REST: it solves the over-fetching or under-fetching of data, is strongly typed, and is capable of retrieving multiple and nested data in one go, but it also comes with drawbacks. For example it creates overhead depending on the request.

Expand Down
2 changes: 1 addition & 1 deletion core/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The API Platform Core Library

API Platform Core is an easy-to-use and powerful library to create [hypermedia-driven REST APIs](http://en.wikipedia.org/wiki/HATEOAS).
API Platform Core is an easy-to-use and powerful library to create [hypermedia-driven REST APIs](https://en.wikipedia.org/wiki/HATEOAS).
It is a component of the [API Platform framework](https://api-platform.com). It can be used as a standalone or with [the Symfony
framework](https://symfony.com) (recommended).

Expand Down
2 changes: 1 addition & 1 deletion core/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ The pagination can now be enabled or disabled by adding a query parameter named
* `GET /books?pagination=false`: disabled
* `GET /books?pagination=true`: enabled

Any value accepted by the [`FILTER_VALIDATE_BOOLEAN`](http://php.net/manual/en/filter.filters.validate.php) filter can be
Any value accepted by the [`FILTER_VALIDATE_BOOLEAN`](https://www.php.net/manual/en/filter.filters.validate.php) filter can be
used as the value.

#### For a specific resource
Expand Down
6 changes: 3 additions & 3 deletions core/swagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ final class SwaggerDecorator implements NormalizerInterface
$docs['paths']['/foos']['get']['parameters'][] = $customDefinition;

// e.g. remove an existing parameter
$docs['paths']['/foos']['get']['parameters'] = array_values(array_filter($docs['paths']['/foos']['get']['parameters'], function ($param){
$docs['paths']['/foos']['get']['parameters'] = array_values(array_filter($docs['paths']['/foos']['get']['parameters'], function ($param) {
return $param['name'] !== 'bar';
}));

Expand Down Expand Up @@ -344,7 +344,7 @@ or with XML:
</resources>
```

![Impact on swagger ui](../distribution/images/swagger-ui-2.png)
![Impact on Swagger UI](../distribution/images/swagger-ui-2.png)

Again, you can use the `openapi_context` key instead of the `swagger_context` one to tweak the OpenAPI **v3** specification.

Expand Down Expand Up @@ -390,7 +390,7 @@ As described [in the Symfony documentation](https://symfony.com/doc/current/temp

You may want to copy the [one shipped with API Platform](https://github.com/api-platform/core/blob/master/src/Bridge/Symfony/Bundle/Resources/views/SwaggerUi/index.html.twig) and customize it.

## Compatibilily Layer with Amazon API Gateway
## Compatibility Layer with Amazon API Gateway

[AWS API Gateway](https://aws.amazon.com/api-gateway/) supports OpenAPI partially, but it [requires some changes](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html).
Fortunately, API Platform provides a way to be compatible with Amazon API Gateway.
Expand Down
2 changes: 1 addition & 1 deletion core/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Refer to [the Symfony HttpClient documentation](https://symfony.com/doc/current/

## API Test Assertions

In addition to [the built-in ones](https://phpunit.readthedocs.io/fr/latest/assertions.html), API Platform provides convenient PHPUnit assertions dedicated to API testing:
In addition to [the built-in ones](https://phpunit.readthedocs.io/en/latest/assertions.html), API Platform provides convenient PHPUnit assertions dedicated to API testing:

```php
<?php
Expand Down
4 changes: 2 additions & 2 deletions core/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

API Platform takes care of validating the data sent to the API by the client (usually user data entered through forms).
By default, the framework relies on [the powerful Symfony Validator Component](http://symfony.com/doc/current/validation.html)
for this task, but you can replace it with your preferred validation library such as [the PHP filter extension](http://php.net/manual/en/intro.filter.php) if you want to.
for this task, but you can replace it with your preferred validation library such as [the PHP filter extension](https://www.php.net/manual/en/intro.filter.php) if you want to.

<p align="center" class="symfonycasts"><a href="https://symfonycasts.com/screencast/api-platform/validation?cid=apip"><img src="../distribution/images/symfonycasts-player.png" alt="Validation screencast"><br>Watch the Validation screencast</a></p>

Expand Down Expand Up @@ -235,7 +235,7 @@ With this configuration, there are three validation groups:
## Dynamic Validation Groups

If you need to dynamically determine which validation groups to use for an entity in different scenarios, just pass in a
[callable](http://php.net/manual/en/language.types.callable.php). The callback will receive the entity object as its first
[callable](https://www.php.net/manual/en/language.types.callable.php). The callback will receive the entity object as its first
argument, and should return an array of group names or a [group sequence](http://symfony.com/doc/current/validation/sequence_provider.html).

In the following example, we use a static method to return the validation groups:
Expand Down
2 changes: 1 addition & 1 deletion deployment/heroku.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deploying an API Platform App on Heroku

[Heroku](http://heroku.com) is a popular, fast, scalable and reliable *Platform As A Service* (PaaS). As Heroku offers a
[Heroku](https://www.heroku.com) is a popular, fast, scalable and reliable *Platform As A Service* (PaaS). As Heroku offers a
free plan including database support through [Heroku Postgres](https://www.heroku.com/postgres), it's a convenient way
to experiment with API Platform.

Expand Down
2 changes: 1 addition & 1 deletion deployment/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package manager) chart to deploy in a wink on any of these platforms.

## Creating and Publishing the Docker Images

1. Build the PHP and Nginx Docker images:
1. Build the PHP and NGINX Docker images:

docker build -t gcr.io/test-api-platform/php -t gcr.io/test-api-platform/php:latest api --target api_platform_php
docker build -t gcr.io/test-api-platform/nginx -t gcr.io/test-api-platform/nginx:latest api --target api_platform_nginx
Expand Down
10 changes: 5 additions & 5 deletions distribution/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This starts the following services:
| db | A PostgreSQL database server | 5432 | all (prefer using a managed service in prod) |
| client | A development server for the Progressive Web App | 80 | dev (use a static website hosting service in prod) |
| admin | A development server for the admin | 81 | dev (use a static website hosting service in prod) |
| api | The HTTP server for the API (Nginx) | 8080 | all |
| api | The HTTP server for the API (NGINX) | 8080 | all |
| mercure | The Mercure hub, [for real-time capabilities](../core/mercure.md) | 1337 | all (prefer using the managed version in prod) |
| h2-proxy | A HTTP/2 and HTTPS development proxy for all apps | 443 (client)<br>444 (admin)<br>8443 (api)<br>1338 (mercure) | dev (configure properly your web server in prod) |

Expand All @@ -98,7 +98,7 @@ you'll got auto-completion for almost everything and awesome quality analysis.
The API Platform distribution comes with a dummy entity for test purpose: `api/src/Entity/Greeting.php`. We will remove
it later.

If you're used to the PHP ecosystem, you probably guessed that this test entity uses the industry-leading [Doctrine ORM](http://www.doctrine-project.org/projects/orm.html)
If you're used to the PHP ecosystem, you probably guessed that this test entity uses the industry-leading [Doctrine ORM](https://www.doctrine-project.org/projects/orm.html)
library as persistence system. It is shipped, in the API Platform distribution.
Doctrine ORM is the easiest way to persist and query data in an API Platform project thanks to the bridge shipped with the
distribution. It is optimized for performance and development convenience. For instance, when using Doctrine, API Platform
Expand Down Expand Up @@ -143,9 +143,9 @@ And start the built-in PHP server:
$ php -S 127.0.0.1:8000 -t public

All JavaScript components are also [available as standalone libraries](https://github.com/api-platform?language=javascript)
installable with NPM or Yarn.
installable with npm or Yarn.

**Note:** when installing API Platform this way, the API will be exposed as the `/api/` path. You need to open `http://localhost:8000/api/` to see the API documentation. If you are deploying API Platform directly on an Apache or Nginx webserver and getting a 404 error on opening this link, you will need to enable the [rewriting rules](https://symfony.com/doc/current/setup/web_server_configuration.html) for your specific webserver software.
**Note:** when installing API Platform this way, the API will be exposed as the `/api/` path. You need to open `http://localhost:8000/api/` to see the API documentation. If you are deploying API Platform directly on an Apache or NGINX webserver and getting a 404 error on opening this link, you will need to enable the [rewriting rules](https://symfony.com/doc/current/setup/web_server_configuration.html) for your specific webserver software.

## It's Ready!

Expand Down Expand Up @@ -482,7 +482,7 @@ By the way, you may want to [embed documents](../core/serialization.md) instead
(e.g. to reduce the number of HTTP requests). You can even [let the client select only the properties it needs](../core/filters.md#property-filter).

The other interesting thing is how API Platform handles dates (the `publicationDate` property). API Platform understands
[any date format supported by PHP](http://php.net/manual/en/datetime.formats.date.php). In production we strongly recommend
[any date format supported by PHP](https://www.php.net/manual/en/datetime.formats.date.php). In production we strongly recommend
using the format specified by the [RFC 3339](http://tools.ietf.org/html/rfc3339), but, as you can see, most common formats
including `September 21, 2016` can be used.

Expand Down
Loading