Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Parameters for some HTTP verbs only #72

Closed
Neamar opened this issue Apr 7, 2014 · 12 comments
Closed

Parameters for some HTTP verbs only #72

Neamar opened this issue Apr 7, 2014 · 12 comments

Comments

@Neamar
Copy link
Contributor

Neamar commented Apr 7, 2014

Here is an excerpt from a blueprint:

## Documents [/documents{?search, ?before, ?after}]
Access documents resources.

### List documents [GET]
Search for documents matching specified filter.

+ Parameters
    + search (optional, string, `john smith`) ... Search query
    + before (optional, date, `2014-03-21`) ... Only display documents created before this date.
    + after (optional, date, `2014-01-25`) ... Only display documents created after this date.
+ Response 200

### Create new document [POST]
Send a new document.

The three parameters needs to be defined at resource level, else I get a warning:

>> Line 259: parameter 'search' not specified in 'Documents' its '/documents' URI template (warning code 8)
>> Line 259: parameter 'before' not specified in 'Documents' its '/documents' URI template (warning code 8)
>> Line 259: parameter 'after' not specified in 'Documents' its '/documents' URI template (warning code 8)

However, they're only relevant for GET verb.

Am i doing something wrong? How can we define parameters for some verbs only?

@zdne zdne added the question label Apr 7, 2014
@zdne
Copy link
Contributor

zdne commented Apr 7, 2014

@Neamar

Your approach is correct however the URI template is not. It should be:

## Documents [/documents{?search,before,after}]

After that Apiary should display the parameters only for the List documents action. Also see my comments (on the complexity of URI Templates RFC) here: #40 (comment)

@rcrooks
Copy link

rcrooks commented Apr 7, 2014

@zdne

should that be:
## Documents [/documents{?{search},{before},{after}]

@Neamar
Copy link
Contributor Author

Neamar commented Apr 7, 2014

I tried both syntax, no success.

I'm using aglio, but copy pasting the blueprint it in apiary.io remains the same: see for instance http://docs.anyfetch.apiary.io/#documents

Am I missing something?

Sorry

@zdne
Copy link
Contributor

zdne commented Apr 7, 2014

@Neamar check this example http://docs.temp10.apiary.io

Also please make sure to use the "new" Apiary rendered documentation – this is not supported in the older one.

@zdne
Copy link
Contributor

zdne commented Apr 7, 2014

@rcrooks

The correct syntax should be /documents{?search,before,after} (without any spaces).

I really need to add the checks for this into API Blueprint parser...

@Neamar
Copy link
Contributor Author

Neamar commented Apr 7, 2014

I activated the new Apiary, but can't seem to make it work. Parameters still appears.
Gosh, i feel so dumb ><

On the other end, i plan to keep using @danielgtaylor aglio for the time being. Will the new parser be made available?

@zdne
Copy link
Contributor

zdne commented Apr 7, 2014

@Neamar

Does this work as you intended http://docs.queryparam2.apiary.io ?

@Neamar
Copy link
Contributor Author

Neamar commented Apr 7, 2014

Indeed it does. Thanks :)

The problem was I simplified my use-case and have some parameters for GET, some other for POST.
This does not seems to be supported, and that was why i didn't get the expected result.

@zdne
Copy link
Contributor

zdne commented Apr 7, 2014

@Neamar

That should be eventually supported in Apiary as well. At the moment it handles correctly only the basic situations like the one I have documented.

Sorry about the frustration. I feel the urge and plan to address the (lack of) URI templates support in the parser.

OK to close?

@Neamar
Copy link
Contributor Author

Neamar commented Apr 7, 2014

Yep, let's close that.

Once again thanks for your quick replies

@Neamar Neamar closed this as completed Apr 7, 2014
Neamar referenced this issue in AnyFetch/developers.anyfetch.com Apr 18, 2014
@techguydave
Copy link

@zdne

Is there a timeline or roadmap for when this feature might appear? I'm interested in it as well.

@zdne
Copy link
Contributor

zdne commented Sep 1, 2014

@synth3tk it should be live soon – we are currently working on a fix of few bugs related to this in Apiary – see #88 (comment) for details

leejo added a commit to payprop/swagger2-markdown that referenced this issue Jun 14, 2016
see apiaryio/api-blueprint#72 for info

bump VERSION and Changes for CPAN release
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants