Comments (6)
@kmayoral: Can you give me an example of that? Like say,
http://api.acme.com/:required/:optional
and if :optional
is blank, it sends http://api.acme.com/bob/:optional
? Would it make more sense to treat the optional param as another resource/method?
Example:
http://api.acme.com/:resource
- Return all from resource
http://api.acme.com/:resource/:specific
- Return a specific item from resource
http://api.acme.com/users
- All users
http://api.acme.com/users/bob
- Just bob
from iodocs.
kmiyashiro - yup your example is exactly what I was bringing up. You're right that creating another resource/method could solve the problem easily, but I guess it'd be more of a convenience to have both cases be handled by the same resource/method if they relate to the same type of request.
I guess as an example, if there was a method to retrieve a paginated list of items from a gallery of sorts, you could optionally specify :optional_start_page
to state the page you want to start retrieving items from, but if left unspecified, it would default to returned the first page.
http://api.acme.com/gallery/:optional_start_page
These cases could be split into two different resource/method entries in the system, but it would just be convenient to be handle them in one case to avoid duplication in the API view page.
That being said, you did bring up a working alternative approach for my original issue (creating another method), so if this request isn't implemented, it won't hurt the functionality of the system.
Thanks for hearing me out though!
from iodocs.
Yeah, shouldn't be too hard to add. I also noticed we don't have client-side validation for required fields which is kind of related.
from iodocs.
It would be nice to get more docs about support for non-query-string parameters (in README.md).
Right now there is no example of such possibility, which makes the casual user think it is not supported
from iodocs.
I have the same issue as originally posted, I want to be able to generate a URI in the from: "/api/test/get/:param1"
But, I can't tell from this thread if it has been made possible and, if so, how to do it.
Thanks
from iodocs.
I'd also like to be able to make restful parameters optional without resorting to another resource. I should be able to do /pets and /pets/123 in the same resource definition. Is there a way to do this?
from iodocs.
Related Issues (20)
- No info displayed about parameters in the endpoints
- iodocs hangs on starting a request with a path parameter containing spaces
- Format updater HOT 2
- Exception in file read HOT 9
- How to generate I/O Docs clients automatically?
- parameter type json HOT 2
- File in Response Body
- JSON example on readme.md is invalid
- Schema Documentation HOT 1
- Performance Issues
- Long integer content-parameters issue HOT 1
- iodocs npm start don't run on mac HOT 3
- include external json schema
- Object inside Array Doesn't have a field name
- Information required on iodocs
- Show response body on all requests
- Using a parameter named 'length'
- demo link 404
- Adapt Authoring Tool Issue
- schema for OpenAPI 2.0 IN JSON format
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 iodocs.