zircote/swagger-php
Generate OpenAPI 3.0/3.1/3.2 specs from PHP 8.2+ code using attributes (preferred) or legacy Doctrine annotations. Provides a CLI and programmatic API, extracts from phpdoc, and reports errors with context for REST API documentation.
OA\Items by @DerManoMann in https://github.com/zircote/swagger-php/pull/2127Contracts namespace for all spec related interfaces by @DerManoMann in https://github.com/zircote/swagger-php/pull/2129Full Changelog: https://github.com/zircote/swagger-php/compare/6.6.0...6.7.0
$ref type-hints to accept OA\Schema\Ref by @DerManoMann in https://github.com/zircote/swagger-php/pull/2119OA\Property when stacking witbh OA\Schema by @DerManoMann in https://github.com/zircote/swagger-php/pull/2121contains() method by @DerManoMann in https://github.com/zircote/swagger-php/pull/2122ref with eachRef() by @DerManoMann in https://github.com/zircote/swagger-php/pull/2123ComponentIndex for lazy resolution of $ref values and component lookups by @DerManoMann in https://github.com/zircote/swagger-php/pull/2124Full Changelog: https://github.com/zircote/swagger-php/compare/6.5.3...6.6.0
Post, 'Put, PatchandDelete` by @DerManoMann in https://github.com/zircote/swagger-php/pull/2109getDirectInterfaces into AttributeFactory by @DerManoMann in https://github.com/zircote/swagger-php/pull/2112mergeAllOf and dedupAllOfRefs logic into Refs augmenter by @DerManoMann in https://github.com/zircote/swagger-php/pull/2113php-cs-fixer rule ordered_class_elements by @DerManoMann in https://github.com/zircote/swagger-php/pull/2116OA\Schema\Ref which can be used as schema and on ref: directyl by @DerManoMann in https://github.com/zircote/swagger-php/pull/2117Full Changelog: https://github.com/zircote/swagger-php/compare/6.5.2...6.5.3
AttributeTranslatorInterface by @DerManoMann in https://github.com/zircote/swagger-php/pull/2096TokenScanner by @DerManoMann in https://github.com/zircote/swagger-php/pull/2099foreach loops with unpacking operations by @DerManoMann in https://github.com/zircote/swagger-php/pull/2102description attribute from #[OA\Property] annotation by @DerManoMann in https://github.com/zircote/swagger-php/pull/2103OpenApi31Compiler: consolidate repetitive patterns by @DerManoMann in https://github.com/zircote/swagger-php/pull/2106Full Changelog: https://github.com/zircote/swagger-php/compare/6.5.1...6.5.2
content parameter (MediaType) to accept MediaType|array|null by @DerManoMann in https://github.com/zircote/swagger-php/pull/2088Specefication to build Result by @DerManoMann in https://github.com/zircote/swagger-php/pull/2093Builder sources to accept \Reflector instances too (except in CLASSIC mode) by @DerManoMann in https://github.com/zircote/swagger-php/pull/2091Items by @DerManoMann in https://github.com/zircote/swagger-php/pull/2094spec-attributes.md; content no longer relevant or needed by @DerManoMann in https://github.com/zircote/swagger-php/pull/2095Full Changelog: https://github.com/zircote/swagger-php/compare/6.5.0...6.5.1
This version introduces the spec pipeline - a new set of attributes that will replace the current (classic) annotations/attributes.
It is using a radically different approach in how the code is organized which makes it a lot easier to maintain.
Right now, the new code is disabled and nothing changes. Key is that in order to try the new code the new OpenApi\Builder needs to be used. Again - using the Builder will, by default, change nothing and the current classic code is used.
The new Builder::setMode() method allows to run the new spec pipeline in two modes:
HYBRID: Enables spec support where found and also routes all classic annotations/attributes through the new spec pipeline.
Under the hood the classic Generator is used to load/instantiate classic annotations/attributes. Then a custom bridge translates all of those into new thin OpenApi\Spec attributes and adds them to the spec pipeline.SPEC: Only new spec attributes are processed.HYBRID is a good way to see how compatible things are and also a migration path, as a codebase could be upgrade file by file.
All spec pipeline related commits have been omitted from the change list for clarity and brevity. Going forward these will be marked as feat(Spec): and listed as all other changes.
All current tests pass in HYBRID mode. However, there hasn't been any testing on actual projects yet. Testing the new code in hybrid mode on existing projects and feedback would be greatly appreciated.
CustomName/Blink with CustomName-Blink in examples and annotations by @DerManoMann in https://github.com/zircote/swagger-php/pull/2069Full Changelog: https://github.com/zircote/swagger-php/compare/6.4.0...6.5.0
Full Changelog: https://github.com/zircote/swagger-php/compare/6.3.2...6.4.0
Utils namespace by @DerManoMann in https://github.com/zircote/swagger-php/pull/2041multiline_comment_opening_closing rule by @DerManoMann in https://github.com/zircote/swagger-php/pull/2043composer/package-versions-deprecated by @DerManoMann in https://github.com/zircote/swagger-php/pull/2049Full Changelog: https://github.com/zircote/swagger-php/compare/6.3.1...6.3.2
Utils\DocBlockParser by @DerManoMann in https://github.com/zircote/swagger-php/pull/2038TokenScannerand other utils to OpenApi\Utils namespace by @DerManoMann in https://github.com/zircote/swagger-php/pull/2039Full Changelog: https://github.com/zircote/swagger-php/compare/6.3.0...6.3.1
Full Changelog: https://github.com/zircote/swagger-php/compare/6.2.0...6.3.0
AbstractAnnotation::$_context non-nullable by @krissss in https://github.com/zircote/swagger-php/pull/2008GeneratorAwareInterface::setGenerator() and align related code by @DerManoMann in https://github.com/zircote/swagger-php/pull/2013Full Changelog: https://github.com/zircote/swagger-php/compare/6.1.2...6.2.0
array<K, V> to type: object + additionalProperties by @krissss in https://github.com/zircote/swagger-php/pull/2003Full Changelog: https://github.com/zircote/swagger-php/compare/6.1.1...6.1.2
Full Changelog: https://github.com/zircote/swagger-php/compare/6.1.0...6.1.1
ext-json by @DerManoMann in https://github.com/zircote/swagger-php/pull/1974bin/openapi to Symfony Console by @yceruto in https://github.com/zircote/swagger-php/pull/1977Full Changelog: https://github.com/zircote/swagger-php/compare/6.0.6...6.1.0
Full Changelog: https://github.com/zircote/swagger-php/compare/6.0.5...6.0.6
Full Changelog: https://github.com/zircote/swagger-php/compare/5.8.2...5.8.3
npm tools deps by @github-actions[bot] in https://github.com/zircote/swagger-php/pull/1955deepObject parameter to attribute Parameter by @github-actions[bot] in https://github.com/zircote/swagger-php/pull/1958Full Changelog: https://github.com/zircote/swagger-php/compare/5.8.1...5.8.2
npm tools deps by @DerManoMann in https://github.com/zircote/swagger-php/pull/1954deepObject parameter to attribute Parameter by @DerManoMann in https://github.com/zircote/swagger-php/pull/1957Full Changelog: https://github.com/zircote/swagger-php/compare/6.0.4...6.0.5
master by @DerManoMann in https://github.com/zircote/swagger-php/pull/1938Generator::isDefault() where appropriate by @DerManoMann in https://github.com/zircote/swagger-php/pull/1940TypeInfoTypeResolver by @DerManoMann in https://github.com/zircote/swagger-php/pull/1945Full Changelog: https://github.com/zircote/swagger-php/compare/6.0.3...6.0.4
Generator::isDefault() where appropriate by @github-actions[bot] in https://github.com/zircote/swagger-php/pull/1941Full Changelog: https://github.com/zircote/swagger-php/compare/5.8.0...5.8.1
unevaluatedProperties support by @github-actions[bot] in https://github.com/zircote/swagger-php/pull/1908Items' case to NestedSchema scratch fixture by @DerManoMann in https://github.com/zircote/swagger-php/pull/1933Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.8...5.8.0
Generator default config and allow to show in CLI by @DerManoMann in https://github.com/zircote/swagger-php/pull/1925Full Changelog: https://github.com/zircote/swagger-php/compare/6.0.2...6.0.3
Schema with items set (#1916) by @DerManoMann in https://github.com/zircote/swagger-php/pull/1916Full Changelog: https://github.com/zircote/swagger-php/compare/6.0.1...6.0.2
phpunit deps and some related issues by @DerManoMann in https://github.com/zircote/swagger-php/pull/1909rector/rector dependency to ^2.3.1 by @DerManoMann in https://github.com/zircote/swagger-php/pull/1913Full Changelog: https://github.com/zircote/swagger-php/compare/6.0.0...6.0.1
Tag annotations by @github-actions[bot] in https://github.com/zircote/swagger-php/pull/1897query operation by @github-actions[bot] in https://github.com/zircote/swagger-php/pull/1898rector/rector dependency to ^2.3.1 by @github-actions[bot] in https://github.com/zircote/swagger-php/pull/1914rector/rector dependency to ^2.3.1" by @DerManoMann in https://github.com/zircote/swagger-php/pull/1915Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.7...5.7.8
radebatz/type-info-extras is now a required dependencyTypeInfoTypeResolver is now the default^8.0 to deps list by @DerManoMann in https://github.com/zircote/swagger-php/pull/1854method_exists checks by @DerManoMann in https://github.com/zircote/swagger-php/pull/1862doctrine/annotations by @DerManoMann in https://github.com/zircote/swagger-php/pull/1870'3.1.2' and '3.2.0' by @DerManoMann in https://github.com/zircote/swagger-php/pull/1871patternProperties to attributes by @DerManoMann in https://github.com/zircote/swagger-php/pull/1876$additionalProperties by @DerManoMann in https://github.com/zircote/swagger-php/pull/1878jsonSerialize() return type by @DerManoMann in https://github.com/zircote/swagger-php/pull/1883summary/description default value to support null as user provided value by @DerManoMann in https://github.com/zircote/swagger-php/pull/1886Tag annotations by @DerManoMann in https://github.com/zircote/swagger-php/pull/1893query operation by @DerManoMann in https://github.com/zircote/swagger-php/pull/1894unevaluatedProperties support by @DerManoMann in https://github.com/zircote/swagger-php/pull/1907Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.3...6.0.0
Tag annotations by @DerManoMann in https://github.com/zircote/swagger-php/pull/1893query operation by @DerManoMann in https://github.com/zircote/swagger-php/pull/1894Full Changelog: https://github.com/zircote/swagger-php/compare/6.0.0-RC3...6.0.0-RC4
doctrine/annotations by @DerManoMann in https://github.com/zircote/swagger-php/pull/1870'3.1.2' and '3.2.0' by @DerManoMann in https://github.com/zircote/swagger-php/pull/1871patternProperties to attributes by @DerManoMann in https://github.com/zircote/swagger-php/pull/1876$additionalProperties by @DerManoMann in https://github.com/zircote/swagger-php/pull/1878jsonSerialize() return type by @DerManoMann in https://github.com/zircote/swagger-php/pull/1883summary/description default value to support null as user provided value by @DerManoMann in https://github.com/zircote/swagger-php/pull/1886Full Changelog: https://github.com/zircote/swagger-php/compare/6.0.0-RC2...6.0.0-RC3
'3.1.2' and '3.2.0' by @DerManoMann in https://github.com/zircote/swagger-php/pull/1872patternProperties to attributes by @DerManoMann in https://github.com/zircote/swagger-php/pull/1877summary/description default value to support null as user provided value (#1886) by @DerManoMann in https://github.com/zircote/swagger-php/pull/1889Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.6...5.7.7
Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.5...5.7.6
^8.0 to deps list by @DerManoMann in https://github.com/zircote/swagger-php/pull/1854method_exists checks by @DerManoMann in https://github.com/zircote/swagger-php/pull/1862Full Changelog: https://github.com/zircote/swagger-php/compare/6.0.0-RC1...6.0.0-RC2
AugmentItems processor by @DerManoMann in https://github.com/zircote/swagger-php/pull/1863Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.4...5.7.5
Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.3...5.7.4
Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.3...6.0.0-RC1
oneOf, allOf and anyOf when deciding on whether to modify the schema type by @DerManoMann in https://github.com/zircote/swagger-php/pull/1847Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.2...5.7.3
array in LegacyTypeResolver by @DerManoMann in https://github.com/zircote/swagger-php/pull/1844false by @DerManoMann in https://github.com/zircote/swagger-php/pull/1849Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.1...5.7.2
Components into a single one by @DerManoMann in https://github.com/zircote/swagger-php/pull/1836LegacyTypeResolver by @DerManoMann in https://github.com/zircote/swagger-php/pull/1843MediaType::encoding values by @DerManoMann in https://github.com/zircote/swagger-php/pull/1845Full Changelog: https://github.com/zircote/swagger-php/compare/5.7.0...5.7.1
Encoding annotation to manage MediaType encodings by @DerManoMann in https://github.com/zircote/swagger-php/pull/1835Full Changelog: https://github.com/zircote/swagger-php/compare/5.6.1...5.7.0
contentEncoding and contentMediaType to Schema by @DerManoMann in https://github.com/zircote/swagger-php/pull/1831method_exists on reflector by @DjordyKoert in https://github.com/zircote/swagger-php/pull/1833Full Changelog: https://github.com/zircote/swagger-php/compare/5.6.0...5.6.1
Type resolver refactor by @DerManoMann in https://github.com/zircote/swagger-php/pull/1829 This 2nd round moved all data manipulation from the analyser and annotation factories into the a appropriate processors and improved type resolvers. Drops support for:
Context::typeContext:nullableMark Analysis::getSchemaForSource() as deprecated by @DerManoMann in https://github.com/zircote/swagger-php/pull/1830
Full Changelog: https://github.com/zircote/swagger-php/compare/5.5.2...5.6.0
Full Changelog: https://github.com/zircote/swagger-php/compare/5.5.1...5.5.2
Context has a reflector and is not nested by @DerManoMann in https://github.com/zircote/swagger-php/pull/1824Full Changelog: https://github.com/zircote/swagger-php/compare/5.5.0...5.5.1
radebatz/type-info-extras by @DerManoMann in https://github.com/zircote/swagger-php/pull/1821Full Changelog: https://github.com/zircote/swagger-php/compare/5.4.2...5.5.0
array as $type type in mapNativeType() by @DerManoMann in https://github.com/zircote/swagger-php/pull/1812Full Changelog: https://github.com/zircote/swagger-php/compare/5.4.1...5.4.2
GeneratorAwareInterface by @DerManoMann in https://github.com/zircote/swagger-php/pull/1813GeneratorAwareInterface also when setting new Pipeline by @DerManoMann in https://github.com/zircote/swagger-php/pull/1814Analysis::process() as deprecated by @DerManoMann in https://github.com/zircote/swagger-php/pull/1815Full Changelog: https://github.com/zircote/swagger-php/compare/5.4.0...5.4.1
How can I help you explore Laravel packages today?