Comments (4)
I think there are a few options we can do:
- Add a
methods
attribute to the<class>
element for controllers inmill.xml
, that takes a comma separated list of methods.- Pros
- Makes it very clear what methods of your controllers are being documented.
- Cons
- Config file will become incredibly large, and unwieldy with tens, to hundreds of
<class>
entries. - This would break the
<directory>
element for specifying a directory of controllers to scan.
- Config file will become incredibly large, and unwieldy with tens, to hundreds of
- Pros
- Look at all the pubic methods that exist on the controller
- Pros
- No configuration changes needed or required for this to work
- Cons
- Will make documentation validation a little trickier as right now Mill throws errors if a resource action is undocumented. So we could make it that if there is no
@api-uri
on the public method that it's looking at, it'll just ignore it completely. Downside to that, though, is that if you ever forget to add that annotation, that action isn't going to be in your documentation.
- Will make documentation validation a little trickier as right now Mill throws errors if a resource action is undocumented. So we could make it that if there is no
- Pros
In any case, we'd need to add a new, required, @api-method
annotation for documenting the REST method that that action is supported on. Unclear if we'd allow multiple of those on a single action.
from mill.
Another option we can do is support regex on methods
annotations. So if you don't support GET
, PATCH
, etc. but at least have a common format for your controller methods, that might work.
<directory name="controllers/" suffix=".php" methods="^get(.+)" />
<class name="\MyApplication\Some\Controller" methods="^handle(.+)" />
It's not horrible.
from mill.
Along with the config change necessary to handle this, we'll also need to update the @api-uri
annotation to support supplying an HTTP method, since that method will no longer be obtained by the class method.
Maybe:
@api-uri:visibility {Movies} GET:/movies
from mill.
The new plan is to introduce an @api-method
annotation that'll solve all of these problems automatically.
from mill.
Related Issues (20)
- Force subtypes to be present on `array` types.
- Grouping classes in single `use` statement leads to errors being discovered HOT 4
- Need a way to document array object payloads
- Need a way to document array parameter examples.
- Better change detection
- Add vendor tag and private filters to the compile command
- Make data annotations flagged as required by default
- Changelog compiler doesn't use the compiler version
- Changelog compilation is incredibly slow HOT 1
- Documentation groups should be configurable
- Add a `--verbose` option to the CLI compiler
- Union types?
- Allow for documenting array/collection responses.
- Documenting scope changes
- Error-coded responses should be compiled in numerical order
- Strange handling of linebreaks
- Improper handling of enum descriptions on parameter tokens
- Decouple the OpenAPI filtering logic into a separate tool
- Private parameters not getting x-mill-visibility-private attached in the OAS
- Translate common path parameters into structured common parameters
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 mill.