on develop help sign in
Rendering service level methods and resources in the TOC
commit03430696f616d3f46bf4f3209a0929d14b6667c9 authorBrendan Hay <brendan.g.hay@gmail.com> dateWed 30 Sep 2015, 11:46 (11 years ago) parent3c58ff8
7 files changed+23−16
gen/Setup.hs+1−1 gen/annex/replicapool.json+1−1 gen/annex/replicapoolupdater.json+1−1 gen/annex/resourceviews.json+1−1 gen/src/Gen/Syntax.hs+1−1 gen/src/Gen/Types/Schema.hs+7−7 gen/template/toc.ede+11−4
gen/Setup.hs+1−1
@@ -1,2 +1,2 @@
1−import Distribution.Simple
1+import Distribution.Simple
22main = defaultMain
gen/annex/replicapool.json+1−1
@@ -1,4 +1,4 @@
11{
2− "library": "instancegroups-manager",
2+ "library": "replicapool",
33 "canonicalName": "InstanceGroups.Manager"
44}
gen/annex/replicapoolupdater.json+1−1
@@ -1,5 +1,5 @@
11{
2− "library": "instancegroups-updater",
2+ "library": "replicapool-updater",
33 "canonicalName": "InstanceGroups.Updater"
44}
55
gen/annex/resourceviews.json+1−1
@@ -1,5 +1,5 @@
11{
2− "library": "instancegroups",
2+ "library": "resourceviews",
33 "canonicalName": "InstanceGroups"
44}
55
gen/src/Gen/Syntax.hs+1−1
@@ -80,9 +80,9 @@ verbAlias n m = TypeDecl noLoc n [] alias
8080 let t = terminalType (_type (_pParam x))
8181 n = sing (local k)
8282 in case _pLocation x of
83− Query -> Just $ TyApp (TyApp (tycon "QueryParam") n) t
8483 Query | x ^. iRepeated
8584 -> Just $ TyApp (TyApp (tycon "QueryParams") n) t
85+ Query -> Just $ TyApp (TyApp (tycon "QueryParam") n) t
8686 Path -> Nothing
8787
8888 params = _mParameters m
gen/src/Gen/Types/Schema.hs+7−7
@@ -254,17 +254,17 @@ instance HasInfo a => HasInfo (Param a) where
254254
255255data MediaUpload = MediaUpload
256256 { _muAccept :: [Text]
257− , _muMaxSize :: Text
257+ , _muMaxSize :: Maybe Text
258258 , _muResumablePath :: Text
259259 , _muSimplePath :: Text
260260 } deriving (Eq, Show)
261261
262262instance FromJSON MediaUpload where
263263 parseJSON = withObject "mediaUpload" $ \o -> MediaUpload
264− <$> o .: "accept"
265− <*> o .: "maxSize"
266− <*> (o .: "protocols" >>= (.: "resumable") >>= (.: "path"))
267− <*> (o .: "protocols" >>= (.: "simple") >>= (.: "path"))
264+ <$> o .: "accept"
265+ <*> o .:? "maxSize"
266+ <*> (o .: "protocols" >>= (.: "resumable") >>= (.: "path"))
267+ <*> (o .: "protocols" >>= (.: "simple") >>= (.: "path"))
268268
269269data Method a = Method
270270 { _mId :: Global
@@ -344,7 +344,7 @@ data Description a = Description
344344 , _dId :: Text
345345 , _dName :: Text
346346 , _dVersion :: Text
347− , _dRevision :: Text
347+ , _dRevision :: Maybe Text
348348 , _dTitle :: Text
349349 , _dDescription :: Help
350350 , _dIcons :: Map Text Text
@@ -372,7 +372,7 @@ instance FromJSON a => FromJSON (Description a) where
372372 <*> o .: "id"
373373 <*> o .: "name"
374374 <*> o .: "version"
375− <*> o .: "revision"
375+ <*> o .:? "revision"
376376 <*> o .: "title"
377377 <*> o .: "description"
378378 <*> o .: "icons"
gen/template/toc.ede+11−4
@@ -11,15 +11,22 @@
1111-- /See:/ <{{ documentationLink }} {{ title }} Reference>
1212module {{ moduleName }}
1313 (
14− -- * REST Resources
15−
16− -- ** {{ title }}
14+ -- * API
1715 {{ api.aliasName }}
1816 , {{ api.aliasProxy }}
1917 , {{ api.url.name }}
18+
19+ -- * Service Methods
2020 {% for action in api.methods %}
2121
22− -- ** {{ action.value.prettyName }}
22+ -- ** {{ action.value.id }}
23+ , module {{ action.value.ns }}
24+ {% endfor %}
25+
26+ -- * REST Resources
27+ {% for action in api.resources %}
28+
29+ -- ** {{ action.value.id }}
2330 , module {{ action.value.ns }}
2431 {% endfor %}
2532