Comments (5)
Swagger-php is only able to pick up on inheritance if the doc-block with the @swg\Model is directly above the "class X extends Y" line.
from swagger-php.
That sounded promising (there is nothing about that anywhere in the documentation I think). But when I tried it didn't work:
/**
* @SWG\Model(id="User") */
class User extends Person
{
This changes nothing in the JSON.
from swagger-php.
Now I debugged the parser and it turns out that the Model ID of Swagger and the class name have to be identical β which only appears to be the case in the example I posted up there, because that example is fake and has nothing to do with my codeβ¦
It seems like I have to restructure my Model ID system, which I don't really like to do because there is a sense in having names differing from each other (there are mulitple model classes with the same name in different namespaces but they represent different Swagger Models, so I needed to add a suffix to the name).
I don't think Swagger supports something like namespacing for Model IDs. Is there a way to have the Annotations Parser map the name of the extended class to the name of the Swagger Model ID?
from swagger-php.
I've upgraded the inheritance logic to use the fully qualified classnames instead of the model->ids.
there is nothing about that anywhere in the documentation I think
Contributions to the docs are highly appreciated.
Which are located in the gh-branch: https://github.com/zircote/swagger-php/tree/gh-pages/docs
from swagger-php.
Okay, thanks for adding this functionality!
from swagger-php.
Related Issues (20)
- Broken links in https://zircote.github.io/swagger-php/ HOT 1
- Support unevaluatedProperties OpenAPI 3.1 HOT 2
- Remove server URL below @OA\Info HOT 2
- Php 8 HOT 2
- How to generate response by attribute? HOT 1
- [v4.7.16] Backed enum broken? HOT 2
- Serialization of data using swagger-php attributes HOT 1
- issues 4.8.1 update HOT 1
- Warning: Skipping unknown \Controller Warning: Required @OA\PathItem() not found Warning: Required @OA\Info() not found HOT 20
- Error for generating swagger.json file from PHP 8.1.25 in xampp environment. HOT 1
- Warning: Skipping unknown | Warning: Required @OA\PathItem() | not found Warning: Required @OA\Info() not found when generating the swagger.json files HOT 5
- Dereferencing refs in the output openapi document HOT 2
- Cannot overwrite generated schema HOT 2
- Using existing Schema classes as a ref for Example classes HOT 2
- How to achieve the the class based architecture for the my QueryParameter::class like we do in Responses HOT 4
- Required @OA\\PathItem() not found HOT 2
- Bump PHP dep from 7.2 to 7.4 [v5] HOT 6
- Documentation of enum property in Property attribute with a null value HOT 1
- Nullable combined with allOf issue HOT 1
- Example: Is it possible to merge OA\Components ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-php.