NelmioApiDocBundle
Copilot instructions2.4k starsChanged 2 years agoMITView on GitHub
Follow these mandatory guidelines when contributing code, documentation, and translations to this repository. All contributions will be reviewed for compliance. Adhere to the Symfony Coding Standards and Best Practices alongside the following specific rules:
We split this copilot-instructions.md into the rules it gives an agent
33 rules. About 0 are common, 10 are distinctive, and 23 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
23
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Follow these mandatory guidelines when contributing code, documentation, and translations to this repository.
- Distinctive: line 11
Target PHP: Use modern PHP 8.2 syntax and features.
- Distinctive: line 23
PSR Compliance: Follow PSR-1, PSR-2, PSR-4, and PSR-12 standards.
- Very specific: line 24
Strictness: Always use strict comparisons (===) and not loose (==).
- Very specific: line 25
Yoda Conditions: Use Yoda conditions for comparisons (e.g., if (null === $value)).
- Very specific: line 26
Braces: Use braces {} in all control structures, even for one-liners.
- Distinctive: line 27
One Class Per File: Use one class per file (except for tests).
- Distinctive: line 28
Trailing Commas: Use trailing commas in multi-line arrays and parameter lists.
- Very specific: line 34
Test Setup/Teardown (setUp() / tearDown())
- Very specific: line 38
Add a blank line before return, unless it is the only line in the block.
- Very specific: line 39
Use return null; for nullable returns and return.
- Distinctive: line 58
Start with a capital letter and end with a dot.
- Very specific: line 59
Do not: use backticks (
`). - Very specific: line 61
Use get_debug_type() for inserting class names into messages.
- Distinctive: line 67
Code Comments: Add code comments only for complex or unintuitive code.
- Distinctive: line 69
Do not: use one-line docblocks.
- Very specific: line 70
Avoid
@return: if the method returns void. - Very specific: line 72
Put null last in union types (e.g., string|null).
- Very specific: line 80
Instantiation: Use parentheses when instantiating classes, even without arguments (new MyClass();).
- Very specific: line 81
useStatements: Add use statements for all non-global classes. - Distinctive: line 90
Syntax: Use the reStructuredText syntax.
- Very specific: line 91
Headings: Use the specified heading symbols for levels 1–5: =, -, ~, ., ".
- Very specific: line 92
Code Blocks: Prefer :: over .. code-block:: php unless it causes formatting issues.
- Very specific: line 97
Realism: Use realistic and meaningful examples.
- Very specific: line 98
Placeholders: Use Acme for vendor names and example.com / example.org / example.net for URLs.
- Very specific: line 99
Directory Root: Use your-project/ as the root directory in examples.
- Very specific: line 107
Quotes: Never use typographic quotes (curly quotes).
- Very specific: line 110
Add trailing slashes when referencing directories (e.g., src/).
- Very specific: line 111
Use a leading dot for file extensions (e.g., .html.twig).
- Very specific: line 112
Twig/Assets: Use snake_case for Twig templates and assets (e.g., template.html.twig, style.scss).
- Distinctive: line 116
Language: Write in American English.
- Very specific: line 118
Person: Use the second person (you) and avoid the first person (we).
- Very specific: line 119
Inclusivity: Use gender-neutral language (they/them).
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI Contribution Guidelines: Enhanced
Follow these mandatory guidelines when contributing code, documentation, and translations to this repository. All contributions will be reviewed for compliance.
General Project Overview
- Project Scope: This is a standalone third-party Symfony bundle.
- Compatibility: Code must be compatible with Symfony 6.4, and 7.x versions.
- Target PHP: Use modern PHP 8.2 syntax and features.
- Deprecations: Avoid using deprecated Symfony or PHP features. Consult the Symfony Backward Compatibility Promise for accepted changes during review.
- Readability: Break text lines in documentation at ~72–78 characters for optimal readability.
PHP Code Standards
Adhere to the Symfony Coding Standards and Best Practices alongside the following specific rules:
Fundamentals
- PSR Compliance: Follow PSR-1, PSR-2, PSR-4, and PSR-12 standards.
- Strictness: Always use strict comparisons (
===) and not loose (==). - Yoda Conditions: Use Yoda conditions for comparisons (e.g.,
if (null === $value)). - Braces: Use braces
{}in all control structures, even for one-liners. - One Class Per File: Use one class per file (except for tests).
- Trailing Commas: Use trailing commas in multi-line arrays and parameter lists.
Structure and Organization
- Class Order:
- Constructor (
__construct()) - Test Setup/Teardown (
setUp()/tearDown()) - Class properties
- Methods (ordered:
public→protected→private)
- Constructor (
- Return Statements:
- Add a blank line before
return, unless it is the only line in the block. - Use
return null;for nullable returns andreturn;for void functions.
- Add a blank line before
- Control Flow: Avoid
else,elseif, orbreakafter a block that returns or throws.
Naming Conventions
- Case Conventions:
camelCase: Variables and method names.snake_case: Configuration keys, routing names, and Twig template/asset names.SCREAMING_SNAKE_CASE: Class constants.UpperCamelCase(PascalCase): PHP class, interface, trait, and enum names.
- Suffixing/Prefixing:
- Interfaces: Suffix with
Interface(e.g.,MyInterface). - Traits: Suffix with
Trait(e.g.,MyTrait). - Exceptions: Suffix with
Exception(e.g.,MyException). - Abstract Classes: Prefix with
Abstract, except for test cases (e.g.,AbstractFactory).
- Interfaces: Suffix with
Error Handling
- Exception Messages:
- Start with a capital letter and end with a dot.
- Do not use backticks (
`). - Concatenate messages using
sprintf(). - Use
get_debug_type()for inserting class names into messages. - Error messages must be concise but very precise.
- Handling: Handle exceptions explicitly and avoid silent catch blocks (i.e., blocks that catch an exception and do nothing).
PHP Comments & PHPDoc
- Code Comments: Add code comments only for complex or unintuitive code.
- PHPDoc Blocks:
- Do not use one-line docblocks.
- Avoid
@returnif the method returnsvoid. - Group annotations by type.
- Put
nulllast in union types (e.g.,string|null).
Bundle Configuration
- Dependency Injection: Do not use service autowiring; configure all services explicitly.
- Service Configuration: Service configuration must use the PHP format (
config/services.php). - Instantiation: Use parentheses when instantiating classes, even without arguments (
new MyClass();). useStatements: Addusestatements for all non-global classes.
Documentation, Examples & Assets
Documentation Format
- Location: Documentation is stored in the
docs/directory. - Syntax: Use the reStructuredText syntax.
- Headings: Use the specified heading symbols for levels 1–5:
=,-,~,.,". - Code Blocks: Prefer
::over.. code-block:: phpunless it causes formatting issues. - Hyperlinks: Separate link text and its URL (avoid inline hyperlinks).
Code Examples
- Realism: Use realistic and meaningful examples; avoid generic placeholders like
foo,bar, etc. - Placeholders: Use
Acmefor vendor names andexample.com/example.org/example.netfor URLs. - Directory Root: Use
your-project/as the root directory in examples. - Line Length: Break code lines $>85$ characters; use
...to indicate folded code. - Dependencies: Include
usestatements when showing referenced classes. - Command Line: Prefix bash lines with
$. Show the filename as a comment when useful. - Configuration Order: Show all configuration formats in this order: YAML, XML, PHP (or Attributes when applicable).
Strings and Assets
- Quotes: Never use typographic quotes (curly quotes); use straight quotes only:
'and". - String Wraps: Wrap strings (in PHP, CSS, and JavaScript) with single straight quotes (
'). - Paths:
- Add trailing slashes when referencing directories (e.g.,
src/). - Use a leading dot for file extensions (e.g.,
.html.twig).
- Add trailing slashes when referencing directories (e.g.,
- Twig/Assets: Use
snake_casefor Twig templates and assets (e.g.,template.html.twig,style.scss).
Language and Tone
- Language: Write in American English.
- Contractions: Contractions are allowed (e.g., "it's," "you're").
- Person: Use the second person (
you) and avoid the first person (we). - Inclusivity: Use gender-neutral language (
they/them). - Tone: Avoid belittling or exclusionary words (e.g., "just," "obviously," "easy").
Trending
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about nelmio/NelmioApiDocBundle
- zircote/swagger-php“[4.8.7] Version is only available reliably for validation and serialization”GitHub · Mar 25, 2024 · 8 reactions
- zircote/swagger-php“should doctrine annotations be optional?”GitHub · Nov 7, 2023 · 7 reactions
- Stack Overflow“Creating a REST API in Symfony2 using FOSRestBundle - schemas and auto-documentation”Stack Overflow · Jul 3, 2012 · 4 votes
- symfony/ai“[Platform] Make json schema generation extendable”GitHub · Feb 1, 2026 · 3 reactions
- Stack Overflow“swagger-ui How do you hide rest methods not implemented”Stack Overflow · Jun 16, 2017 · 3 votes
The biggest 5 of 67 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 67
Talked about on GitHub, Stack Overflow and Bluesky (67 times).
On GitHub · 50
- Mar 25, 2024[4.8.7] Version is only available reliably for validation and serialization — zircote/swagger-php8 reactions · 7 comments
- Nov 7, 2023should doctrine annotations be optional? — zircote/swagger-php7 reactions
- Feb 1, 2026[Platform] Make json schema generation extendable — symfony/ai3 reactions · 2 comments
- Apr 11, 2023ApiPlatform\OpenApi\OpenApi does not implement \ApiPlatform\Documentation\DocumentationInterface — lexik/LexikJWTAuthenticationBundle2 reactions
- Feb 1, 2013Document the Rest API — FriendsOfSymfony/FOSCommentBundle2 reactions · 1 comment
45 more on GitHub
- Apr 14, 2026[Feature]: (fully) support `Examples` on Property — zircote/swagger-php1 reaction · 5 comments
- Mar 12, 2024Invalid "request" field under "requestBody" — zircote/swagger-php1 reaction · 1 comment
- Jan 5, 2022Revert default OpenAPI version to 3.0.0 — zircote/swagger-php1 reaction · 9 comments
- Apr 18, 2021Defining service locators without a class — symfony/symfony1 reaction · 2 comments
- Oct 28, 2026build(deps): Bump the backend group across 1 directory with 28 updates — refleet-it/refleet0 reactions
- Oct 28, 2026chore(deps): bump the api group across 1 directory with 31 updates — MarouaneFaris/momentum0 reactions
- Oct 28, 2026Bump the minor-updates group across 1 directory with 52 updates — liip/open-swiss-buildings-api0 reactions
- Oct 25, 2026chore(deps): bump the composer-all group across 1 directory with 8 updates — markus-michalski/leaveflow0 reactions · 1 comment
- Oct 21, 2026chore(deps): bump the api group across 1 directory with 31 updates — MarouaneFaris/momentum0 reactions · 1 comment
- Oct 21, 2026chore(deps): bump the minor-and-patch group across 1 directory with 14 updates — albertogalvez-dev/Convive0 reactions
- Oct 19, 2026build(deps): Bump the backend-minor-patch group across 1 directory with 39 updates — blackburn2601/bentley-skeleton0 reactions · 1 comment
- Oct 17, 2026Bump nelmio/api-doc-bundle from 5.9.3 to 5.13.1 — kaevdokimov/symfony6-skeleton0 reactions · 1 comment
- Oct 15, 2026Bump nelmio/api-doc-bundle from 5.12.2 to 5.13.1 in /api — michalper/ai-message-router0 reactions · 1 comment
- Oct 14, 2026build(deps): Bump the backend group across 1 directory with 27 updates — refleet-it/refleet0 reactions · 1 comment
- Oct 14, 2026chore(deps): bump the api group across 1 directory with 30 updates — MarouaneFaris/momentum0 reactions · 1 comment
- Oct 14, 2026Bump the minor-updates group across 1 directory with 50 updates — liip/open-swiss-buildings-api0 reactions · 1 comment
- Oct 14, 2026build(deps): Bump the backend-minor-patch group across 1 directory with 37 updates — blackburn2601/bentley-skeleton0 reactions · 2 comments
- Oct 13, 2026chore(deps): bump the minor-and-patch group across 1 directory with 15 updates — albertogalvez-dev/Convive0 reactions · 1 comment
- Oct 13, 2026chore(deps): bump the composer-minor-patch group across 1 directory with 26 updates — Geolid/symfony-ddd-cqrs-es0 reactions · 1 comment
- Oct 11, 2026chore(deps): bump the composer-all group across 1 directory with 6 updates — markus-michalski/leaveflow0 reactions · 1 comment
- Oct 9, 2026Bump nelmio/api-doc-bundle from 5.13.0 to 5.13.1 in /app — zlotylesk/AIHomeManager0 reactions
- Oct 9, 2026Chore(deps): Bump the dependencies group across 1 directory with 5 updates — tarlepp/symfony-flex-backend0 reactions · 1 comment
- Oct 8, 2026Bump nelmio/api-doc-bundle from 5.12.2 to 5.13.0 in /api — michalper/ai-message-router0 reactions · 2 comments
- Oct 7, 2026chore(deps): bump the composer group across 1 directory with 37 updates — k2gl/pragmatic-franken0 reactions
- Oct 7, 2026Chore(deps): Bump the dependencies group across 1 directory with 2 updates — tarlepp/symfony-flex-backend0 reactions · 1 comment
- Oct 7, 2026Bump the minor-updates group across 1 directory with 47 updates — liip/open-swiss-buildings-api0 reactions · 1 comment
- Oct 6, 2026Bump nelmio/api-doc-bundle from 5.12.2 to 5.13.0 in /app — zlotylesk/AIHomeManager0 reactions
- Oct 6, 2026Chore(deps): Bump nelmio/api-doc-bundle from 5.12.2 to 5.13.0 in the dependencies group — tarlepp/symfony-flex-backend0 reactions · 1 comment
- Oct 5, 2026build(deps): Bump the backend-minor-patch group across 1 directory with 34 updates — blackburn2601/bentley-skeleton0 reactions · 2 comments
- Oct 5, 2026chore(deps): bump the minor-and-patch group across 1 directory with 14 updates — albertogalvez-dev/Convive0 reactions · 1 comment
- Sep 18, 2026Bump nelmio/api-doc-bundle from 5.12.1 to 5.12.2 in /app — zlotylesk/AIHomeManager0 reactions · 1 comment
- Sep 11, 2026Bump nelmio/api-doc-bundle from 5.12.0 to 5.12.1 in /app — zlotylesk/AIHomeManager0 reactions
- Sep 10, 2026build(deps): bump nelmio/api-doc-bundle from 5.9.5 to 5.12.0 in /EC04/skillhub — Samilazaar/DossierFilrouge0 reactions · 1 comment
- Sep 7, 2026build(deps): bump nelmio/api-doc-bundle from 5.11.1 to 5.12.0 — ilios/ilios0 reactions · 1 comment
- Sep 7, 2026Bump nelmio/api-doc-bundle from 5.11.1 to 5.12.0 in /app — zlotylesk/AIHomeManager0 reactions
- Aug 19, 2026chore: bump nelmio/api-doc-bundle from 5.10.3 to 5.11.1 — krzysztof331/book-rental-system0 reactions
- Aug 14, 2026OpenAPI: UpdateNewsletterInput properties are marked as required — hyvor/post0 reactions
- Aug 10, 2026Bump nelmio/api-doc-bundle from 4.38.7 to 5.11.0 — Smertch/BlogBySymfony-0 reactions · 1 comment
- Jul 14, 2026fix(deps): update dependency nelmio/api-doc-bundle to v5 — sjunior-dev/symfony-api-test0 reactions · 1 comment
- Jun 2, 2026chore(backend): bump nelmio/api-doc-bundle from 4.38.7 to 5.10.3 in /backend — GillesCedric/task-manager0 reactions · 1 comment
- Apr 15, 2026chore(deps): bump nelmio/api-doc-bundle from 5.9.5 to 5.10.0 in /apps/back — GlobalEmergency/apuntate0 reactions · 1 comment
- Apr 13, 2026Update nelmio/api-doc-bundle requirement from ^4.12 to ^5.10 — valantic/pimcore-api-documentation0 reactions · 1 comment
- Dec 6, 2025Подключить swagger — kirin-bear/tourismania-api-symfony0 reactions
- Nov 22, 2025Pasar la documentación a Nelmio — luisriego/Matisse.Api.Sf0 reactions
- Nov 13, 2025BUG: Regression in MediaType encoding in v5.7.0 — zircote/swagger-php0 reactions · 1 comment
On Stack Overflow · 16
- Jul 3, 2012Creating a REST API in Symfony2 using FOSRestBundle - schemas and auto-documentation4 votes
- Jun 16, 2017swagger-ui How do you hide rest methods not implemented3 votes · 2 answers
- Sep 26, 2019How to specify several object type within single property using Swagger and/or JMS serializer?2 votes
- Feb 11, 2019Angular 7 HttpClient POST - Bad request1 vote
- Dec 6, 2017How to use nelmio/api-doc-bundle standalone (without symfony app)?1 vote
11 more on Stack Overflow
- Jan 28, 2013DocBlock / Other Documentation for REST Webservices1 vote
- Oct 21, 2021Group exclusion in Nelmio Api Doc does not work After updating composer0 votes
- Apr 27, 2020Is there a way to add a context for my methods (or exclude methods) in Swagger?0 votes
- May 7, 2019How to use nelmio/api-doc-bundle without symfony?0 votes
- Feb 15, 2017Return entity without database Nelmio Symfony0 votes
- Oct 11, 2016nelmio api doc bundle not render input type0 votes
- May 7, 2015Annotation to show Entity's property description - using nelmioapidocbundle0 votes
- Feb 9, 2015NelmioApiDocBundle hide list of choices0 votes
- Feb 27, 2014Symfony 2.4 Base Project Setup0 votes
- Feb 11, 2013What is the best tool for documenting/generate reference for a RESTful/HTTP RPC API?0 votes
- Apr 23, 2020Is there a way to add a context for my methods (or exclude methods) in Swagger?-2 votes · 1 answer
On Bluesky · 1
- Nov 28, 2025📦 nelmio/api-doc-bundle v4.38.6 Generates documentation for your REST API from attributes 🔗 https://github.com/nelmio/NelmioApiDocBundle — @throwable.bsky.social1 likes and repost
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

