blob: add6922b52ba8af0b55690486eecf6f8687c92d2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
=head1 NAME
Spore - Specifications to a POrtable Rest Environment
=head1 SYNOPSIS
The ReST
(L<http://en.wikipedia.org/wiki/Representational_State_Transfer|Representational
State Transfer>) paradigm has improved the way we communicate between
services and clients over http. It makes API easy to understand and to implement
client libraries for them.
=head1 API DESCRIPTION
An API should provide a description file. The description should be in JSON
format.
The description can have the following fields:
=over 4
=item B<name> (optional)
A simple name to describe the specification (eg: CouchDB)
=item B<author> (optional)
A list of authors for this specification
=item B<api_base_url> (optional)
If the API has a fixed URL
=item B<api_format> (optional)
A list of supported format (eg: JSON, XML)
=item B<version> (optinal)
The version number of the current description
=item B<authentication> (optional)
A boolean to specify if this API requires authentication for all the methods
=item B<methods> (required)
A list of methods
=back
The desciption B<MUST> contain a list of at least one method
=over 4
=item B<method> (required)
An HTTP method (GET/POST/PUT/DELETE)
=item B<path> (required)
Path for the given method. The path can contain B<placeholders>. A placeholder
B<MUST> begin with a <:>:
/:database
=item B<params> (optional)
A list of parameters. This list will be used to replace value in placeholders,
and if not used in the path, will be added to the query
=item B<required> (optional)
A list of required parameters. Parameters that are required B<MUST NOT> be
repeated in the B<params> field
=item B<expected> (optional)
A list of accepted HTTP status for this method. (eg: 200, 201)
=item B<description> (optional)
A simple description for the method. This should not be considered as
documentation.
Fetch a document from a CouchDB database
=item B<authentication> (optional)
A boolean to specify if this method requires authentication
=item B<api_base_url> (optional)
Specify an url if this method requires a different api_base_url
=item B<documentation> (optional)
A complete documentation for the given method
=back
=head3 SAMPLE
=head3 CALLS
|