├── .gitignore ├── .prettierrc ├── admin ├── images │ ├── admin-demo.gif │ ├── admin-demo.mp4 │ ├── admin-menu.png │ ├── admin-sort.png │ ├── admin-demo.webm │ ├── admin-filter.png │ ├── admin-datagrid.png │ ├── required-field.png │ ├── AutocompleteInput.png │ ├── admin-custom-field.png │ ├── admin-custom-input.png │ ├── admin-default-list.png │ ├── admin-form-layout.png │ ├── admin-menu-icons.png │ ├── react-admin-theme.png │ ├── admin-undoable-mutation.png │ ├── basic-admin-greetings.png │ ├── related-record-with-iri.png │ ├── submission-error-field.png │ ├── admin-custom-edit-guesser.png │ ├── admin-custom-list-guesser.png │ ├── admin-custom-show-guesser.png │ ├── admin-tabbed-show-layout.png │ ├── api-platform-admin-theme.png │ ├── api-platform-welcome-page.png │ ├── related-record-with-name.png │ ├── admin-reference-record-count.png │ ├── admin-warnWhenUnsavedChanges.png │ ├── embedded-relation-dot-notation.png │ ├── embedded-relation-full-object.png │ ├── admin-custom-list-field-guesser.png │ ├── embedded-relation-ReferenceField.png │ ├── embedded-relation-ReferenceInput.png │ └── embedded-relation-useEmbedded-false.png ├── file-upload.md ├── performance.md ├── real-time-mercure.md ├── index.md ├── validation.md ├── getting-started.md └── schema.md ├── laravel ├── images │ ├── graphql.png │ ├── basic-rest.png │ ├── empty-docs.png │ ├── read-only.png │ ├── form-request.png │ ├── title-filter.png │ ├── books-collection.png │ ├── filters-documentation.png │ └── property-placeholder.png ├── validation.md ├── security.md └── jwt.md ├── symfony ├── images │ ├── swagger-ui-1.png │ ├── swagger-ui-2.png │ ├── NelmioApiDocBundle.png │ ├── api-platform-2.5-api.png │ ├── api-platform-2.6-api.png │ ├── symfonycasts-player.png │ ├── api-platform-2.5-admin.png │ ├── api-platform-2.6-admin.png │ ├── api-platform-2.5-graphql.png │ ├── api-platform-2.5-pwa-react.png │ ├── api-platform-2.5-welcome.png │ ├── api-platform-2.6-graphql.png │ ├── api-platform-2.6-pwa-react.png │ ├── api-platform-2.6-welcome.png │ ├── api-platform-3.0-welcome.png │ ├── api-platform-2.5-bookshop-api.png │ ├── api-platform-2.6-bookshop-api.png │ └── api-platform-2.6-bookshop-json-schemas.png ├── nelmio-api-doc.md ├── caddy.md ├── debugging.md ├── fosuser-bundle.md └── migrate-from-fosrestbundle.md ├── core ├── images │ ├── JWTAuthorizeButton.png │ ├── JWTConfigureApiKey.png │ ├── SerializerWorkflow.png │ ├── deprecated-graphiql.png │ ├── mercure-discovery.png │ ├── swagger-ui-modified.png │ ├── deprecated-swagger-ui.png │ ├── jwt-token-swagger-ui.png │ ├── mercure-subscriptions.png │ ├── open-api-documented-error.png │ └── diagrams │ │ ├── api-platform-get-i-o.dia │ │ ├── api-platform-get-i-o.png │ │ ├── api-platform-put-i-o.dia │ │ ├── api-platform-put-i-o.png │ │ ├── api-platform-post-i-o.dia │ │ └── api-platform-post-i-o.png ├── validation.md ├── security.md ├── testing.md ├── jwt.md ├── bootstrap.md ├── push-relations.md ├── index.md ├── url-generation-strategy.md ├── form-data.md ├── design.md ├── operation-path-naming.md ├── extending-jsonld-context.md ├── default-order.md ├── external-vocabularies.md ├── json-schema.md ├── upgrade-guide.md └── client-integration.md ├── deployment ├── images │ ├── deploy-result.png │ ├── digitalocean-dns.png │ ├── digitalocean-droplet.png │ ├── google-image-overview.png │ └── google-image-caddy-details.png ├── index.md ├── minikube.md └── heroku.md ├── schema-generator ├── images │ └── stoplight.png ├── index.md └── getting-started.md ├── .github ├── ISSUE_TEMPLATE │ ├── 2_Documentation_issue.md │ └── 1_Support_question.md ├── linters │ └── .textlintrc ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── ci.yml │ └── cd.yml ├── create-client ├── images │ ├── create-client-demo.gif │ ├── nuxt │ │ ├── create-client-nuxt-edit.png │ │ └── create-client-nuxt-list.png │ ├── react │ │ ├── create-client-react-edit.png │ │ ├── create-client-react-list.png │ │ ├── create-client-react-show.png │ │ ├── create-client-react-delete.png │ │ └── create-client-react-list-pagination.png │ ├── nextjs │ │ ├── create-client-nextjs-list.png │ │ └── create-client-nextjs-show.png │ └── react-native │ │ ├── create-client-react-native-add.png │ │ ├── create-client-react-native-list.png │ │ ├── create-client-react-native-show.png │ │ └── create-client-react-native-delete.png ├── typescript.md ├── index.md ├── vuetify.md ├── vuejs.md ├── quasar.md ├── react.md ├── nuxt.md ├── troubleshooting.md ├── react-native.md ├── custom.md └── nextjs.md ├── .proselintrc.json ├── .markdownlint.yaml ├── README.md ├── .editorconfig ├── extra ├── contribution-guides.md ├── releases.md ├── conduct.md ├── philosophy.md ├── enterprise.md ├── troubleshooting.md └── security.md ├── CONTRIBUTING.md └── outline.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | /website 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "proseWrap": "always" 4 | } 5 | -------------------------------------------------------------------------------- /admin/images/admin-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-demo.gif -------------------------------------------------------------------------------- /admin/images/admin-demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-demo.mp4 -------------------------------------------------------------------------------- /admin/images/admin-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-menu.png -------------------------------------------------------------------------------- /admin/images/admin-sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-sort.png -------------------------------------------------------------------------------- /laravel/images/graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/laravel/images/graphql.png -------------------------------------------------------------------------------- /admin/images/admin-demo.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-demo.webm -------------------------------------------------------------------------------- /admin/images/admin-filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-filter.png -------------------------------------------------------------------------------- /laravel/images/basic-rest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/laravel/images/basic-rest.png -------------------------------------------------------------------------------- /laravel/images/empty-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/laravel/images/empty-docs.png -------------------------------------------------------------------------------- /laravel/images/read-only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/laravel/images/read-only.png -------------------------------------------------------------------------------- /admin/images/admin-datagrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-datagrid.png -------------------------------------------------------------------------------- /admin/images/required-field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/required-field.png -------------------------------------------------------------------------------- /laravel/images/form-request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/laravel/images/form-request.png -------------------------------------------------------------------------------- /laravel/images/title-filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/laravel/images/title-filter.png -------------------------------------------------------------------------------- /symfony/images/swagger-ui-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/swagger-ui-1.png -------------------------------------------------------------------------------- /symfony/images/swagger-ui-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/swagger-ui-2.png -------------------------------------------------------------------------------- /admin/images/AutocompleteInput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/AutocompleteInput.png -------------------------------------------------------------------------------- /admin/images/admin-custom-field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-custom-field.png -------------------------------------------------------------------------------- /admin/images/admin-custom-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-custom-input.png -------------------------------------------------------------------------------- /admin/images/admin-default-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-default-list.png -------------------------------------------------------------------------------- /admin/images/admin-form-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-form-layout.png -------------------------------------------------------------------------------- /admin/images/admin-menu-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-menu-icons.png -------------------------------------------------------------------------------- /admin/images/react-admin-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/react-admin-theme.png -------------------------------------------------------------------------------- /core/images/JWTAuthorizeButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/JWTAuthorizeButton.png -------------------------------------------------------------------------------- /core/images/JWTConfigureApiKey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/JWTConfigureApiKey.png -------------------------------------------------------------------------------- /core/images/SerializerWorkflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/SerializerWorkflow.png -------------------------------------------------------------------------------- /core/images/deprecated-graphiql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/deprecated-graphiql.png -------------------------------------------------------------------------------- /core/images/mercure-discovery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/mercure-discovery.png -------------------------------------------------------------------------------- /core/images/swagger-ui-modified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/swagger-ui-modified.png -------------------------------------------------------------------------------- /deployment/images/deploy-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/deployment/images/deploy-result.png -------------------------------------------------------------------------------- /laravel/images/books-collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/laravel/images/books-collection.png -------------------------------------------------------------------------------- /core/images/deprecated-swagger-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/deprecated-swagger-ui.png -------------------------------------------------------------------------------- /core/images/jwt-token-swagger-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/jwt-token-swagger-ui.png -------------------------------------------------------------------------------- /core/images/mercure-subscriptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/mercure-subscriptions.png -------------------------------------------------------------------------------- /schema-generator/images/stoplight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/schema-generator/images/stoplight.png -------------------------------------------------------------------------------- /symfony/images/NelmioApiDocBundle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/NelmioApiDocBundle.png -------------------------------------------------------------------------------- /admin/images/admin-undoable-mutation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-undoable-mutation.png -------------------------------------------------------------------------------- /admin/images/basic-admin-greetings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/basic-admin-greetings.png -------------------------------------------------------------------------------- /admin/images/related-record-with-iri.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/related-record-with-iri.png -------------------------------------------------------------------------------- /admin/images/submission-error-field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/submission-error-field.png -------------------------------------------------------------------------------- /deployment/images/digitalocean-dns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/deployment/images/digitalocean-dns.png -------------------------------------------------------------------------------- /laravel/images/filters-documentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/laravel/images/filters-documentation.png -------------------------------------------------------------------------------- /laravel/images/property-placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/laravel/images/property-placeholder.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.5-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.5-api.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.6-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.6-api.png -------------------------------------------------------------------------------- /symfony/images/symfonycasts-player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/symfonycasts-player.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2_Documentation_issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 📄 Documentation issue 3 | about: Report a documentation issue 4 | --- 5 | -------------------------------------------------------------------------------- /admin/images/admin-custom-edit-guesser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-custom-edit-guesser.png -------------------------------------------------------------------------------- /admin/images/admin-custom-list-guesser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-custom-list-guesser.png -------------------------------------------------------------------------------- /admin/images/admin-custom-show-guesser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-custom-show-guesser.png -------------------------------------------------------------------------------- /admin/images/admin-tabbed-show-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-tabbed-show-layout.png -------------------------------------------------------------------------------- /admin/images/api-platform-admin-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/api-platform-admin-theme.png -------------------------------------------------------------------------------- /admin/images/api-platform-welcome-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/api-platform-welcome-page.png -------------------------------------------------------------------------------- /admin/images/related-record-with-name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/related-record-with-name.png -------------------------------------------------------------------------------- /core/images/open-api-documented-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/open-api-documented-error.png -------------------------------------------------------------------------------- /deployment/images/digitalocean-droplet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/deployment/images/digitalocean-droplet.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.5-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.5-admin.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.6-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.6-admin.png -------------------------------------------------------------------------------- /admin/images/admin-reference-record-count.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-reference-record-count.png -------------------------------------------------------------------------------- /admin/images/admin-warnWhenUnsavedChanges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-warnWhenUnsavedChanges.png -------------------------------------------------------------------------------- /core/images/diagrams/api-platform-get-i-o.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/diagrams/api-platform-get-i-o.dia -------------------------------------------------------------------------------- /core/images/diagrams/api-platform-get-i-o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/diagrams/api-platform-get-i-o.png -------------------------------------------------------------------------------- /core/images/diagrams/api-platform-put-i-o.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/diagrams/api-platform-put-i-o.dia -------------------------------------------------------------------------------- /core/images/diagrams/api-platform-put-i-o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/diagrams/api-platform-put-i-o.png -------------------------------------------------------------------------------- /create-client/images/create-client-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/create-client-demo.gif -------------------------------------------------------------------------------- /deployment/images/google-image-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/deployment/images/google-image-overview.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.5-graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.5-graphql.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.5-pwa-react.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.5-pwa-react.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.5-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.5-welcome.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.6-graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.6-graphql.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.6-pwa-react.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.6-pwa-react.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.6-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.6-welcome.png -------------------------------------------------------------------------------- /symfony/images/api-platform-3.0-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-3.0-welcome.png -------------------------------------------------------------------------------- /admin/images/embedded-relation-dot-notation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/embedded-relation-dot-notation.png -------------------------------------------------------------------------------- /admin/images/embedded-relation-full-object.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/embedded-relation-full-object.png -------------------------------------------------------------------------------- /core/images/diagrams/api-platform-post-i-o.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/diagrams/api-platform-post-i-o.dia -------------------------------------------------------------------------------- /core/images/diagrams/api-platform-post-i-o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/core/images/diagrams/api-platform-post-i-o.png -------------------------------------------------------------------------------- /admin/images/admin-custom-list-field-guesser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/admin-custom-list-field-guesser.png -------------------------------------------------------------------------------- /admin/images/embedded-relation-ReferenceField.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/embedded-relation-ReferenceField.png -------------------------------------------------------------------------------- /admin/images/embedded-relation-ReferenceInput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/embedded-relation-ReferenceInput.png -------------------------------------------------------------------------------- /deployment/images/google-image-caddy-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/deployment/images/google-image-caddy-details.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.5-bookshop-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.5-bookshop-api.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.6-bookshop-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.6-bookshop-api.png -------------------------------------------------------------------------------- /admin/images/embedded-relation-useEmbedded-false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/admin/images/embedded-relation-useEmbedded-false.png -------------------------------------------------------------------------------- /create-client/images/nuxt/create-client-nuxt-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/nuxt/create-client-nuxt-edit.png -------------------------------------------------------------------------------- /create-client/images/nuxt/create-client-nuxt-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/nuxt/create-client-nuxt-list.png -------------------------------------------------------------------------------- /create-client/images/react/create-client-react-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/react/create-client-react-edit.png -------------------------------------------------------------------------------- /create-client/images/react/create-client-react-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/react/create-client-react-list.png -------------------------------------------------------------------------------- /create-client/images/react/create-client-react-show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/react/create-client-react-show.png -------------------------------------------------------------------------------- /create-client/images/nextjs/create-client-nextjs-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/nextjs/create-client-nextjs-list.png -------------------------------------------------------------------------------- /create-client/images/nextjs/create-client-nextjs-show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/nextjs/create-client-nextjs-show.png -------------------------------------------------------------------------------- /create-client/images/react/create-client-react-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/react/create-client-react-delete.png -------------------------------------------------------------------------------- /symfony/images/api-platform-2.6-bookshop-json-schemas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/symfony/images/api-platform-2.6-bookshop-json-schemas.png -------------------------------------------------------------------------------- /create-client/images/react/create-client-react-list-pagination.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/react/create-client-react-list-pagination.png -------------------------------------------------------------------------------- /create-client/images/react-native/create-client-react-native-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/react-native/create-client-react-native-add.png -------------------------------------------------------------------------------- /create-client/images/react-native/create-client-react-native-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/react-native/create-client-react-native-list.png -------------------------------------------------------------------------------- /create-client/images/react-native/create-client-react-native-show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/react-native/create-client-react-native-show.png -------------------------------------------------------------------------------- /create-client/images/react-native/create-client-react-native-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/api-platform/docs/HEAD/create-client/images/react-native/create-client-react-native-delete.png -------------------------------------------------------------------------------- /.github/linters/.textlintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "terminology": { 4 | "exclude": [ 5 | "Node(?:js)?", 6 | "web[- ]?site(s)?" 7 | ] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.proselintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "checks": { 3 | "typography.symbols": false, 4 | "typography.exclamation": false, 5 | "hyperbole.misc": false, 6 | "cliches.misc": false, 7 | "lexical_illusions.misc": false 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | MD013: 3 | line_length: 1000 4 | code_blocks: false 5 | tables: false 6 | no-inline-html: 7 | allowed_elements: [a, p, img, br, code-selector, video, source, iframe, h1] 8 | MD046: 9 | style: fenced 10 | MD004: 11 | style: dash 12 | MD007: 13 | indent: 4 14 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /core/validation.md: -------------------------------------------------------------------------------- 1 | # Validation 2 | 3 | API Platform takes care of validating the data sent to the API by the client (usually user data 4 | entered through forms). 5 | 6 | - For Symfony users, refer to the [Validation with Symfony documentation](/symfony/validation.md). 7 | - For Laravel users, refer to the [Validation with Laravel documentation](/laravel/validation.md). 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/1_Support_question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: ⛔ Support Question 3 | about: See https://api-platform.com/support/ for questions about using API Platform 4 | --- 5 | 6 | # Support question 7 | 8 | We use GitHub issues only to discuss bugs and new features. For this kind of questions about using 9 | API Platform, please use any of the support alternatives shown in 10 | [API Platform support](https://api-platform.com/support/). 11 | 12 | Thanks! 13 | -------------------------------------------------------------------------------- /laravel/validation.md: -------------------------------------------------------------------------------- 1 | # Validation with Laravel 2 | 3 | API Platform simplifies the validation of data sent by clients to the API, typically user inputs 4 | submitted through forms. 5 | 6 | You can add [validation rules](https://laravel.com/docs/validation) within the `rules` option: 7 | 8 | ```php 9 | // app/Models/Book.php 10 | 11 | use ApiPlatform\Metadata\ApiResource; 12 | 13 | #[ApiResource( 14 | rules: [ 15 | 'title' => 'required', 16 | ] 17 | )] 18 | class Book extends Model 19 | { 20 | } 21 | ``` 22 | -------------------------------------------------------------------------------- /core/security.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | API Platform provides advanced authentication and authorization features to secure your API. 4 | 5 | When using API Platform for Symfony, API Platform leverages the 6 | [Symfony Security component](https://symfony.com/doc/current/security.html) to help you secure your 7 | API. 8 | 9 | When using API Platform for Laravel, it provides an integration with popular authentication packages 10 | for Laravel, and with the built-in authorization features of the framework. 11 | 12 | - For Symfony users, refer to the [Security with Symfony documentation](/symfony/security.md). 13 | - For Laravel users, refer to the [Security with Laravel documentation](/laravel/security.md). 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

API Platform

2 | 3 | # API Platform Documentation 4 | 5 | [![Lint](https://github.com/api-platform/docs/actions/workflows/ci.yml/badge.svg)](https://github.com/api-platform/docs/actions/workflows/ci.yml) 6 | 7 | Welcome to the official documentation for [API Platform](https://api-platform.com), a powerful 8 | framework for building APIs and web applications. 9 | 10 | This repository contains all the API Platform documentation resources. 11 | 12 | ## Contributing 13 | 14 | Please check our [CONTRIBUTING file](/CONTRIBUTING.md) to contribute. 15 | -------------------------------------------------------------------------------- /core/testing.md: -------------------------------------------------------------------------------- 1 | # Testing the API 2 | 3 | Once your API is up and running, it's crucial to write tests to ensure it is bug-free and to prevent 4 | future regressions. A good practice is to follow a 5 | [Test-Driven Development (TDD)](https://martinfowler.com/bliki/TestDrivenDevelopment.html) approach, 6 | where tests are written before the production code. 7 | 8 | API Platform provides a set of helpful testing utilities to write unit tests, functional tests, and 9 | to create [test fixtures](https://en.wikipedia.org/wiki/Test_fixture#Software). 10 | 11 | ## Testing Documentations 12 | 13 | - If you are using API Platform with Symfony, refer to the 14 | [Testing the API with Symfony](/symfony/testing.md) documentation. 15 | - If you are using API Platform with Laravel, refer to the 16 | [Testing the API with Laravel](/laravel/testing.md) documentation. 17 | -------------------------------------------------------------------------------- /core/jwt.md: -------------------------------------------------------------------------------- 1 | # JWT Authentication 2 | 3 | > [JSON Web Token (JWT)](https://jwt.io/) is a JSON-based open standard 4 | > ([RFC 7519](https://tools.ietf.org/html/rfc7519)) for creating access tokens that assert some 5 | > number of claims. For example, a server could generate a token that has the claim "logged in as 6 | > admin" and provide that to a client. The client could then use that token to prove that he/she is 7 | > logged in as admin. The tokens are signed by the server's key, so the server is able to verify 8 | > that the token is legitimate. The tokens are designed to be compact, URL-safe and usable 9 | > especially in web browser single sign-on (SSO) context. 10 | > 11 | > ―[Wikipedia](https://en.wikipedia.org/wiki/JSON_Web_Token) 12 | 13 | - For Symfony users, check out the [JWT Authentication with Symfony documentation](/symfony/jwt.md). 14 | - For Laravel users, explore the [JWT Authentication with Laravel documentation](/laravel/jwt.md). 15 | -------------------------------------------------------------------------------- /core/bootstrap.md: -------------------------------------------------------------------------------- 1 | # Bootstrapping the Core Library 2 | 3 | You may want to run a minimal version of API Platform. This one file runs API Platform (without 4 | GraphQL, Eloquent, Doctrine MongoDB...). It requires the following Composer packages: 5 | 6 | > [!NOTE] This documentation is a work in progress we're working on improving it, in the mean time 7 | > we declare most of the services manually in the 8 | > [ApiPlatformProvider](https://github.com/api-platform/core/blob/64768a6a5b480e1b8e33c639fb28b27883c69b79/src/Laravel/ApiPlatformProvider.php) 9 | > it can be source of inspiration. 10 | 11 | ## Components 12 | 13 | API Platform is installable as a set of components, for example: 14 | 15 | ```console 16 | composer require \ 17 | api-platform/serializer \ 18 | api-platform/metadata \ 19 | api-platform/state \ 20 | api-platform/jsonld \ 21 | phpdocumentor/reflection-docblock \ 22 | symfony/property-info \ 23 | symfony/routing \ 24 | symfony/validator 25 | ``` 26 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | # Change these settings to your own preference 9 | indent_style = space 10 | indent_size = 4 11 | 12 | # We recommend you to keep these unchanged 13 | end_of_line = lf 14 | charset = utf-8 15 | trim_trailing_whitespace = true 16 | insert_final_newline = true 17 | 18 | [*.json] 19 | indent_style = space 20 | indent_size = 2 21 | 22 | [*.md] 23 | max_line_length = 100 24 | trim_trailing_whitespace = false 25 | indent_size = 4 26 | 27 | [*.neon] 28 | indent_style = tab 29 | indent_size = 4 30 | 31 | [*.xml] 32 | indent_size = 4 33 | 34 | [*.{yaml,yml}] 35 | indent_size = 2 36 | trim_trailing_whitespace = false 37 | 38 | [.circleci/config.yml] 39 | indent_size = 2 40 | 41 | [.github/workflows/*.yml] 42 | indent_size = 2 43 | 44 | [.gitmodules] 45 | indent_style = tab 46 | 47 | [.proselintrc] 48 | indent_size = 2 49 | -------------------------------------------------------------------------------- /extra/contribution-guides.md: -------------------------------------------------------------------------------- 1 | # Contribution Guides 2 | 3 | ## API Platform Core 4 | 5 | - [General Contribution Guide](https://github.com/api-platform/core/blob/main/CONTRIBUTING.md) 6 | - [Laravel-Specific Contribution Guide](https://github.com/api-platform/core/blob/main/src/Laravel/CONTRIBUTING.md) 7 | 8 | ## API Platform Documentation 9 | 10 | - [General Contribution Guide](https://github.com/api-platform/docs/blob/main/CONTRIBUTING.md) 11 | 12 | ## API Platform Tools 13 | 14 | - [Schema Generator Contribution Guide](https://github.com/api-platform/schema-generator/blob/main/CONTRIBUTING.md) 15 | - [Admin Contribution Guide](https://github.com/api-platform/admin/blob/master/CONTRIBUTING.md) 16 | - [CRUD Generator Contribution Guide](https://github.com/api-platform/create-client/blob/master/CONTRIBUTING.md) 17 | 18 | **To report a security issue, please take a look at [the dedicated document](security.md).** 19 | 20 |

JWT screencast
Watch the Contributing back to Symfony screencast (free)

21 | -------------------------------------------------------------------------------- /deployment/index.md: -------------------------------------------------------------------------------- 1 | # Deploying API Platform Applications 2 | 3 | API Platform apps are super easy to deploy in production thanks to the 4 | [Docker Compose definition](docker-compose.md) and to the [Kubernetes chart](kubernetes.md) we 5 | provide. 6 | 7 | We strongly recommend using Kubernetes or Docker Compose to deploy your apps. 8 | 9 | If you want to play with a local Kubernetes cluster, read 10 | [how to deploy an API Platform project on Minikube](minikube.md). 11 | 12 | If you don't want to use Docker, keep in mind that the server application of API Platform is a 13 | standard Symfony project, while the Progressive Web Application is a standard Next.js project: 14 | 15 |

JWT screencast
Watch the Animated Deployment with Ansistrano screencast

16 | 17 | - [Deploying the Symfony application](https://symfony.com/doc/current/deployment.html) 18 | - [Deploying the Next.js application](https://nextjs.org/docs/deployment) 19 | 20 | Alternatively, you may want to deploy API Platform on a PaaS (Platform as a Service): 21 | 22 | - [Deploying the server application of API Platform on Heroku](heroku.md) 23 | - [Deploying API Platform on Platform.sh (outdated)](https://platform.sh/blog/deploy-api-platform-on-platformsh) 24 | -------------------------------------------------------------------------------- /symfony/nelmio-api-doc.md: -------------------------------------------------------------------------------- 1 | # NelmioApiDocBundle Integration with Symfony 2 | 3 | > [!WARNING] For new projects, prefer using the built-in Swagger support and/or NelmioApiDoc 3. 4 | 5 | NelmioApiDoc provides an alternative to [the native Swagger/Open API support](../core/openapi.md) 6 | provided by API Platform. 7 | 8 | As NelmioApiDocBundle 3+ has built-in support for API Platform, this documentation is only relevant 9 | for people using NelmioApiDocBundle between version 2.9 and 3.0. 10 | 11 | ![Screenshot of API Platform integrated with NelmioApiDocBundle](images/NelmioApiDocBundle.png) 12 | 13 | [NelmioApiDocBundle](https://github.com/nelmio/NelmioApiDocBundle) is supported by API Platform 14 | since version 2.9. 15 | 16 | To enable the NelmioApiDoc integration, copy the following configuration: 17 | 18 | ```yaml 19 | # api/config/packages/api_platform.yaml 20 | api_platform: 21 | # ... 22 | 23 | enable_nelmio_api_doc: true 24 | 25 | nelmio_api_doc: 26 | sandbox: 27 | accept_type: "application/json" 28 | body_format: 29 | formats: ["json"] 30 | default_format: "json" 31 | request_format: 32 | formats: 33 | json: "application/json" 34 | ``` 35 | 36 | Please note that NelmioApiDocBundle has a sandbox limitation where you cannot pass a JSON array as 37 | parameter, so you cannot use it to deserialize nested objects. 38 | -------------------------------------------------------------------------------- /create-client/typescript.md: -------------------------------------------------------------------------------- 1 | # TypeScript Interfaces 2 | 3 | The TypeScript Generator allows you to create 4 | [TypeScript interfaces](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#interfaces) 5 | that you can embed in any TypeScript-enabled project (React, Vue.js, Angular..). 6 | 7 | To do so, run the generator: 8 | 9 | ```console 10 | npm init @api-platform/client https://demo.api-platform.com src/ -- --generator typescript --resource foo 11 | # Replace the URL with the entrypoint of your Hydra-enabled API. 12 | ``` 13 | 14 | `src/` is where the interfaces will be generated. 15 | 16 | Omit the resource flag to generate files for all resource types exposed by the API. You can also use 17 | an OpenAPI documentation with `-f openapi3`. 18 | 19 | This command parses the Hydra documentation and creates one `.ts` file for each API Resource you 20 | have defined in your application, in the `interfaces` subfolder. 21 | 22 | **Note:** If you are not sure what the entrypoint is, see [Troubleshooting](troubleshooting.md). 23 | 24 | ## Example 25 | 26 | Assuming you have 2 resources in your application, `Foo` and `Bar`, when you run: 27 | 28 | ```console 29 | npm init @api-platform/client https://demo.api-platform.com src/ -- --generator typescript 30 | ``` 31 | 32 | You will obtain 2 `.ts` files arranged as following: 33 | 34 | - src/ 35 | - interfaces/ 36 | - foo.ts 37 | - bar.ts 38 | -------------------------------------------------------------------------------- /admin/file-upload.md: -------------------------------------------------------------------------------- 1 | # Handling File Upload 2 | 3 | If you need to handle the file upload in the server part, please follow 4 | [the related documentation](../symfony/file-upload.md). 5 | 6 | This documentation assumes you have a `/media_objects` endpoint accepting 7 | `multipart/form-data`-encoded data. 8 | 9 | To manage the upload in the admin part, you need to 10 | [customize the guessed create or edit form](./customizing.md#from-inputguesser-to-react-admin-inputs). 11 | 12 | Add a [``](https://marmelab.com/react-admin/FileInput.html) as a child of the guesser. 13 | For example, for the create form: 14 | 15 | ```js 16 | import { HydraAdmin, ResourceGuesser, CreateGuesser } from "@api-platform/admin"; 17 | import { FileField, FileInput } from "react-admin"; 18 | 19 | const MediaObjectsCreate = () => ( 20 | 21 | 22 | 23 | 24 | 25 | ); 26 | 27 | export const App = () => ( 28 | 29 | 30 | {/* ... */} 31 | 32 | ); 33 | ``` 34 | 35 | And that's it! The guessers are able to detect that you have used a `FileInput` and are passing this 36 | information to the data provider, through a `hasFileField` field in the `extraInformation` object, 37 | itself in the data. If you are using the Hydra data provider, it uses a `multipart/form-data` 38 | request instead of a JSON-LD one. 39 | 40 | **Note:** In the case of the `EditGuesser`, the HTTP method used becomes a `POST` instead of a 41 | `PUT`, to prevent a [PHP bug](https://bugs.php.net/bug.php?id=55815). 42 | -------------------------------------------------------------------------------- /admin/performance.md: -------------------------------------------------------------------------------- 1 | # Performance Tips 2 | 3 | To make the admin faster and greener, you can make some changes to your API. 4 | 5 | ## Retrieve All Relations in One Request 6 | 7 | By default, if your relations are not embedded and if you decide to display some fields belonging to 8 | relations in your resource list, the admin will fetch the relations one by one. 9 | 10 | In this case, it can be improved by doing only one request for all the related resources instead. 11 | 12 | To do so, you need to make sure the [search filter](../core/doctrine-filters.md#search-filter) is 13 | enabled for the identifier of the related resource. 14 | 15 | For instance, if you have a `book` resource having a relation to `author` resources and you display 16 | the author names on your book list, you can make sure the authors are retrieved in one go by 17 | writing: 18 | 19 | ```php 20 | [!NOTE] Don't hesitate giving as much information as you can. 17 | 18 | ## Code of Conduct 19 | 20 | By contributing to this project, you agree to abide by our 21 | [Code of Conduct](https://github.com/api-platform/docs#coc-ov-file). We expect all contributors to 22 | foster a welcoming and inclusive environment. 23 | 24 | ## How to Contribute 25 | 26 | 1. Fork this repository by clicking the "Fork" button at the top right of the `api-platform/docs` 27 | repository page. 28 | 29 | 2. Clone the forked repository to your local machine: 30 | 31 | ```console 32 | git clone https://github.com/your-username/repository-name.git 33 | ``` 34 | 35 | 3. Create a new branch for your contribution: 36 | 37 | ```console 38 | git switch -c docs-your-branch-name 39 | ``` 40 | 41 | 4. Commit and push your changes 42 | 5. Submit a Pull Request. You must decide on what branch your changes will be based depending of the 43 | nature of the change. See 44 | [the dedicated documentation entry](https://api-platform.com/docs/extra/releases/). 45 | 46 | > [!TIP] You can also contribute to improving the documentation directly by clicking on the **"You 47 | > can also help us improve the documentation of this page."** link, located at the end of each 48 | > documentation page. 49 | -------------------------------------------------------------------------------- /create-client/vuetify.md: -------------------------------------------------------------------------------- 1 | # Vuetify Generator 2 | 3 | Bootstrap a Vuetify 3 application using `create-vuetify`: 4 | 5 | ```console 6 | npm init vuetify -- --typescript --preset essentials 7 | cd my-app 8 | ``` 9 | 10 | Install the required dependencies: 11 | 12 | ```console 13 | npm install dayjs qs @types/qs vue-i18n 14 | ``` 15 | 16 | To generate all the code you need for a given resource run the following command: 17 | 18 | ```console 19 | npm init @api-platform/client https://demo.api-platform.com src/ -- --generator vuetify --resource book 20 | ``` 21 | 22 | Replace the URL with the entrypoint of your Hydra-enabled API. You can also use an OpenAPI 23 | documentation with `https://demo.api-platform.com/docs.jsonopenapi` and `-f openapi3`. 24 | 25 | Omit the resource flag to generate files for all resource types exposed by the API. 26 | 27 | **Note:** Make sure to follow the result indications of the command to register the routes and the 28 | translations. 29 | 30 | Then add this import in `src/plugins/vuetify.ts`: 31 | 32 | ```typescript 33 | // src/plugins/vuetify.ts 34 | import { VDataTableServer } from "vuetify/labs/VDataTable"; 35 | ``` 36 | 37 | In the same file replace the export with: 38 | 39 | ```typescript 40 | // src/plugins/vuetify.ts 41 | export default createVuetify({ 42 | components: { 43 | VDataTableServer, 44 | }, 45 | }); 46 | ``` 47 | 48 | In `src/plugins/index.ts` add this import: 49 | 50 | ```typescript 51 | // src/plugins/index.ts 52 | import i18n from "@/plugins/i18n"; 53 | ``` 54 | 55 | In the same file add `.use(i18n)` chained with the other `use()` functions. 56 | 57 | You can launch the server with: 58 | 59 | ```console 60 | npm run dev 61 | ``` 62 | 63 | Go to `http://localhost:3000/books/` to start using your app. 64 | 65 | **Note:** In order to Mercure to work with the demo, you have to use the port 3000. 66 | -------------------------------------------------------------------------------- /admin/real-time-mercure.md: -------------------------------------------------------------------------------- 1 | # Real-time Updates With Mercure 2 | 3 | API Platform Admin support real-time updates by using the [Mercure protocol](https://mercure.rocks). 4 | 5 | Updates are received by using the `useMercureSubscription` hook in the `ListGuesser`, `ShowGuesser` 6 | and `EditGuesser` components. 7 | 8 | To enable Mercure server-side, see the [related documentation](../core/mercure.md). 9 | 10 | Once enabled, API Platform Admin for Hydra will automatically detect that Mercure is enabled and 11 | will discover the Mercure hub URL by itself. 12 | 13 | ## Advanced Configuration 14 | 15 | If you want to customize the default Mercure configuration, you can either do it with a prop in the 16 | `` or `` component: 17 | 18 | ```javascript 19 | import { OpenApiAdmin } from "@api-platform/admin"; 20 | 21 | export default () => ( 22 | 27 | ); 28 | ``` 29 | 30 | Or in the data provider factory: 31 | 32 | ```javascript 33 | import { hydraDataProvider, fetchHydra } from "@api-platform/admin"; 34 | import { parseHydraDocumentation } from "@api-platform/api-doc-parser"; 35 | 36 | const dataProvider = baseHydraDataProvider({ 37 | entrypoint, 38 | httpClient: fetchHydra, 39 | apiDocumentationParser: parseHydraDocumentation, 40 | mercure: { hub: "https://mercure.rocks/hub" }, 41 | }); 42 | ``` 43 | 44 | The `mercure` object can take the following properties: 45 | 46 | - `hub`: the URL to your Mercure hub (default value: null ; when null it will be discovered by using 47 | API responses) 48 | - `jwt`: a subscriber JWT to access your Mercure hub (default value: null) 49 | - `topicUrl`: the topic URL of your resources (default value: entrypoint) 50 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Lint 3 | 4 | on: 5 | push: 6 | pull_request: 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | proselint: 13 | name: Prose Lint 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v4 18 | 19 | - uses: actions/cache@v4 20 | with: 21 | path: ~/.cache/pip 22 | key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} 23 | restore-keys: | 24 | ${{ runner.os }}-pip- 25 | 26 | - name: Install Proselint 27 | run: pip install --quiet --user proselint 28 | 29 | - name: Run Proselint 30 | run: find . -name '*.md' -exec proselint {} \; 31 | lint: 32 | name: Lint 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - name: Checkout code 37 | uses: actions/checkout@v4 38 | 39 | - uses: DavidAnson/markdownlint-cli2-action@v21 40 | with: 41 | globs: '**/*.md' 42 | 43 | prettier-format: 44 | name: Prettier 45 | runs-on: ubuntu-latest 46 | steps: 47 | - name: Checkout code 48 | uses: actions/checkout@v4 49 | 50 | - name: Setup Node.js 51 | uses: actions/setup-node@v4 52 | with: 53 | node-version: '20' 54 | 55 | - name: Prettier Dry Run 56 | run: | 57 | npx prettier --check "**/*.md" || { 58 | echo "::error title=Formatting Failed::Some files are not formatted correctly." 59 | echo "-------------------------------------------------------" 60 | echo "❌ CHECK FAILED" 61 | echo "To fix these issues, run the following command locally:" 62 | echo "" 63 | echo " npx prettier --write \"**/*.md\" --prose-wrap always" 64 | echo "" 65 | echo "-------------------------------------------------------" 66 | exit 1 67 | } 68 | -------------------------------------------------------------------------------- /extra/releases.md: -------------------------------------------------------------------------------- 1 | # The Release Process 2 | 3 | API Platform follows the [Semantic Versioning](https://semver.org) strategy. A new minor version is 4 | released every six months, and a new major version is released every two years, along with a last 5 | minor version on the previous major one with the same features and an upgrade path. 6 | 7 | For example: 8 | 9 | - version 3.0 has been released on 15 September 2022; 10 | - version 3.1 has been released on 23 January 2023; 11 | - version 3.2 has been released on 12 October 2023; 12 | - version 3.3 has been released on 9 April 2024 (we were a little late, it should have been 13 | published in March); 14 | - versions 3.4 has been released on 18 September 2024; 15 | - versions 4.0 has been released on 27 September 2024; 16 | - versions 4.1 has been released on 28 February 2025; 17 | - versions 4.2 has been released on 18 September 2025; 18 | 19 | ## Maintenance 20 | 21 | 3 versions are maintained at the same time: 22 | 23 | - **stable** (currently the **4.2** branch): regular bugfixes are integrated in this version 24 | - **old-stable** (are the last branch: **4.1**): [security fixes](security.md) are integrated in 25 | this version, regular bugfixes are **not** backported in it 26 | - **development** (**main** branch): new features target this branch 27 | 28 | Older versions (1.x, 2.6..., 3.0..., 4.0) **are not maintained**. If you still use them, you must 29 | upgrade as soon as possible. 30 | 31 | The **old-stable** branch is merged in the **stable** branch on a regular basis to propagate 32 | [security fixes](security.md). The **stable** branch is merged in the **development** branch on a 33 | regular basis to propagate [security](security.md) and regular bugfixes. 34 | 35 | New major versions of API Platform are released every 2 years. New minor versions of API Platform 36 | are released every 6 months. 37 | 38 | The latest minor version of a major branch contains all the new features introduced in the first 39 | version of the next major, but also contains deprecated features which are removed in the next major 40 | branch. 41 | -------------------------------------------------------------------------------- /create-client/vuejs.md: -------------------------------------------------------------------------------- 1 | # Vue.js Generator 2 | 3 | Bootstrap a Vue 3 application using create-vue: 4 | 5 | ```console 6 | npm init vue@latest -- --typescript --router --pinia --eslint-with-prettier my-app 7 | cd my-app 8 | ``` 9 | 10 | Install the required dependencies: 11 | 12 | ```console 13 | npm install dayjs qs @types/qs 14 | ``` 15 | 16 | To generate all the code you need for a given resource run the following command: 17 | 18 | ```console 19 | npm init @api-platform/client https://demo.api-platform.com src/ -- --generator vue --resource book 20 | ``` 21 | 22 | Replace the URL with the entrypoint of your Hydra-enabled API. You can also use an OpenAPI 23 | documentation with `https://demo.api-platform.com/docs.jsonopenapi` and `-f openapi3`. 24 | 25 | Omit the resource flag to generate files for all resource types exposed by the API. 26 | 27 | **Note:** Make sure to follow the result indications of the command to register the routes. 28 | 29 | Replace the content of `App.vue` with the following code: 30 | 31 | ```html 32 | // src/App.vue 33 | 36 | 37 | 40 | ``` 41 | 42 | Optionally, install Tailwind to get an app that looks good: 43 | 44 | ```console 45 | npm install -D tailwindcss postcss autoprefixer 46 | npx tailwindcss init -p 47 | ``` 48 | 49 | Replace the content of `tailwind.config.js` by: 50 | 51 | ```js 52 | // tailwind.config.js 53 | /** @type {import('tailwindcss').Config} */ 54 | module.exports = { 55 | content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"], 56 | theme: { 57 | extend: {}, 58 | }, 59 | plugins: [], 60 | }; 61 | ``` 62 | 63 | Replace the content of `src/assets/main.css` by: 64 | 65 | ```css 66 | @tailwind base; 67 | @tailwind components; 68 | @tailwind utilities; 69 | ``` 70 | 71 | You can launch the server with: 72 | 73 | ```console 74 | npm run dev 75 | ``` 76 | 77 | Go to `http://localhost:5173/books/` to start using your app. 78 | 79 | **Note:** In order to Mercure to work with the demo, you have to use the port 3000. 80 | -------------------------------------------------------------------------------- /create-client/quasar.md: -------------------------------------------------------------------------------- 1 | # Quasar Framework Generator 2 | 3 | Create a Quasar Framework application using [Quasar CLI](https://quasar.dev/start/quasar-cli): 4 | 5 | ```console 6 | npm i -g @quasar/cli 7 | npm init quasar 8 | cd my-app 9 | ``` 10 | 11 | It will ask you some questions, you can use these answers: 12 | 13 | ```console 14 | What would you like to build ? App with Quasar CLI, let's go! 15 | Project folder: my-app 16 | Pick Quasar version: Quasar v2 (Vue 3 | latest and greatest) 17 | Pick script types: Typescript 18 | Pick Quasar App CLI variant: Quasar App CLI with Vite 19 | Package name: my-app 20 | Pick a Vue component style: Composition API with