Skip to content

Commit

Permalink
Remove optional parameters in sys/
Browse files Browse the repository at this point in the history
Removed optional parameters from sys/, test/, and remaining mentions in v1/.

Bug: T218218
  • Loading branch information
clarakosi authored and d00rman committed Apr 9, 2019
1 parent 74d4cce commit 982e38c
Show file tree
Hide file tree
Showing 11 changed files with 242 additions and 47 deletions.
17 changes: 11 additions & 6 deletions sys/key_rev_value.yaml
Expand Up @@ -8,13 +8,18 @@ paths:
put:
operationId: createBucket

/{bucket}/{key}/:
get:
operationId: listRevisions

/{bucket}/{key}{/revision}{/tid}:
/{bucket}/{key}: &bucket_key
get:
operationId: getRevision
/{bucket}/{key}/{revision}{/tid}:
put:
operationId: putRevision

/{bucket}/{key}/:
get:
operationId: listRevisions

/{bucket}/{key}/{revision}:
<<: *bucket_key

/{bucket}/{key}/{revision}/{tid}:
<<: *bucket_key
15 changes: 12 additions & 3 deletions sys/mobileapps.yaml
@@ -1,15 +1,24 @@
info:
title: Mobileapps sys API module
paths:
/mobile-sections/{title}{/revision}:
/mobile-sections/{title}: &mobile-sections_title
get:
operationId: getSections

/mobile-sections-lead/{title}{/revision}:
/mobile-sections/{title}/{revision}:
<<: *mobile-sections_title

/mobile-sections-lead/{title}: &mobile-sections-lead_title
get:
operationId: getSectionsLead

/mobile-sections-remaining/{title}{/revision}:
/mobile-sections-lead/{title}/{revision}:
<<: *mobile-sections-lead_title

/mobile-sections-remaining/{title}: &mobile-sections-remaining_title
get:
operationId: getSectionsRemaining

/mobile-sections-remaining/{title}/{revision}:
<<: *mobile-sections-remaining_title

19 changes: 15 additions & 4 deletions sys/multi_content_bucket.yaml
Expand Up @@ -7,12 +7,23 @@ paths:
/:
put:
operationId: createBucket
/{content}/{key}: &content_key
get:
operationId: getRevision

/{content}/{key}/:
get:
operationId: listRevisions
/{content}/{key}{/revision}{/tid}:
get:
operationId: getRevision
/all/{key}/{revision}{/tid}:

/{content}/{key}/{revision}:
<<: *content_key

/{content}/{key}/{revision}/{tid}:
<<: *content_key

/all/{key}/{revision}: &all_key_revision
put:
operationId: putRevision

/all/{key}/{revision}/{tid}:
<<: *all_key_revision
12 changes: 7 additions & 5 deletions sys/page_revisions.yaml
Expand Up @@ -10,6 +10,11 @@ paths:
type: string
required: false

/page/{title}: &page_title
get:
summary: Get the revision metadata for a specific revision
operationId: getTitleRevision

/page/{title}/:
get:
summary: List revisions for a title (page history)
Expand All @@ -21,8 +26,5 @@ paths:
type: string
required: false

/page/{title}{/revision}:
get:
summary: Get the revision metadata for a specific revision
operationId: getTitleRevision

/page/{title}/{revision}:
<<: *page_title
83 changes: 67 additions & 16 deletions sys/parsoid.yaml
Expand Up @@ -7,14 +7,25 @@ info:
API through the `action` module.
paths:

/pagebundle/{title}{/revision}{/tid}:
/pagebundle/{title}: &pagebundle_title
get:
summary: Retrieve a JSON bundle containing html and data-parsoid
operationId: getPageBundle
post:
summary: Retrieve a JSON bundle containing html and data-parsoid
operationId: getPageBundle

/pagebundle/{title}/{revision}:
<<: *pagebundle_title

/pagebundle/{title}/{revision}/{tid}:
<<: *pagebundle_title

/wikitext/{title}: &wikitext_title
get:
summary: Retrieve the wikitext for a title and revision.
operationId: getWikitext

/wikitext/{title}/:
get:
summary: List Wikitext revisions.
Expand All @@ -26,10 +37,16 @@ paths:
type: string
required: false

/wikitext/{title}{/revision}{/tid}:
/wikitext/{title}/{revision}:
<<: *wikitext_title

/wikitext/{title}/{revision}/{tid}:
<<: *wikitext_title

/html/{title}: &html_title
get:
summary: Retrieve the wikitext for a title and revision.
operationId: getWikitext
summary: Retrieve the HTML for title and revision.
operationId: getHtml

/html/{title}/:
get:
Expand All @@ -42,10 +59,16 @@ paths:
type: string
required: false

/html/{title}{/revision}{/tid}:
/html/{title}/{revision}:
<<: *html_title

/html/{title}/{revision}/{tid}:
<<: *html_title

/data-parsoid/{title}: &data-parsoid_title
get:
summary: Retrieve the HTML for title and revision.
operationId: getHtml
summary: Retrieve the data-parsoid JSON for title & revision.
operationId: getDataParsoid

/data-parsoid/{title}/:
get:
Expand All @@ -58,36 +81,64 @@ paths:
type: string
required: false

/data-parsoid/{title}{/revision}{/tid}:
get:
summary: Retrieve the data-parsoid JSON for title & revision.
operationId: getDataParsoid
/data-parsoid/{title}/{revision}:
<<: *data-parsoid_title

/data-parsoid/{title}/{revision}/{tid}:
<<: *data-parsoid_title

/lint/{title}{/revision}:
/lint/{title}: &lint_title
get:
summary: Retreive the lint errors for a specific page revision
operationId: getLintErrors

/transform/html/to/html{/title}{/revision}:
/lint/{title}/{revision}:
<<: *lint_title

/transform/html/to/html: &transform_html_to_html
post:
summary: Update HTML, while optionally passing in title & revision.
operationId: transformHtmlToHtml

/transform/html/to/wikitext{/title}{/revision}:
/transform/html/to/html/{title}:
<<: *transform_html_to_html

/transform/html/to/html/{title}/{revision}:
<<: *transform_html_to_html

/transform/html/to/wikitext: &transform_html_to_wikitext
post:
summary: Transform HTML to wikitext.
operationId: transformHtmlToWikitext

/transform/wikitext/to/html{/title}{/revision}:
/transform/html/to/wikitext/{title}:
<<: *transform_html_to_wikitext

/transform/html/to/wikitext/{title}/{revision}:
<<: *transform_html_to_wikitext

/transform/wikitext/to/html: &transform_wikitext_to_html
post:
summary: Transform wikitext to HTML.
operationId: transformWikitextToHtml

/transform/wikitext/to/lint{/title}{/revision}:
/transform/wikitext/to/html/{title}:
<<: *transform_wikitext_to_html

/transform/wikitext/to/html/{title}/{revision}:
<<: *transform_wikitext_to_html

/transform/wikitext/to/lint: &transform_wikitext_to_lint
post:
summary: Check the wikitext for lint errors.
operationId: transformWikitextToLint

/transform/wikitext/to/lint/{title}:
<<: *transform_wikitext_to_lint

/transform/wikitext/to/lint/{title}/{revision}:
<<: *transform_wikitext_to_lint

/transform/changes/to/wikitext/{title}/{revision}:
post:
summary: Transform section changes to wikitext.
Expand Down
4 changes: 3 additions & 1 deletion sys/post_data.yaml
Expand Up @@ -12,9 +12,11 @@ paths:
put:
operationId: putRevision

/{bucket}/{key}{/tid}:
/{bucket}/{key}: &bucket_key
get:
operationId: getRevision
/{bucket}/{key}/{tid}:
<<: *bucket_key

/{bucket}/hash:
post:
Expand Down
5 changes: 4 additions & 1 deletion test/test_module.yaml
Expand Up @@ -10,7 +10,7 @@ paths:
title: Wikimedia testing APIs
x-is-api-root: true
paths:
/service/test/{title}{/revision}:
/service/test/{title}: &service_test_title
get:
x-setup-handler:
- init_storage:
Expand Down Expand Up @@ -46,6 +46,9 @@ paths:

x-monitor: false

/service/test/{title}/{revision}:
<<: *service_test_title

/service/test_parallel/{key1}/{key2}:
get:
x-request-handler:
Expand Down
31 changes: 27 additions & 4 deletions v1/content.yaml
Expand Up @@ -87,7 +87,7 @@ paths:
x-request-handler:
- get_from_backend:
request:
uri: /{domain}/sys/page_revisions/page/{title}{/revision}
uri: /{domain}/sys/page_revisions/page/{title}
headers:
# FIXME: Temporary work-around (see T120212).
cache-control: 'no-cache'
Expand Down Expand Up @@ -126,6 +126,14 @@ paths:
description: The revision id
type: integer
required: true
x-request-handler:
- get_from_backend:
request:
uri: /{domain}/sys/page_revisions/page/{title}/{revision}
headers:
# FIXME: Temporary work-around (see T120212).
cache-control: 'no-cache'
if-unmodified-since: '{{if-unmodified-since}}'
x-monitor: false

/html/{title}:
Expand Down Expand Up @@ -527,7 +535,7 @@ paths:
x-request-handler:
- get_from_backend:
request:
uri: /{domain}/sys/parsoid/html/{title}/{revision}{/tid}
uri: /{domain}/sys/parsoid/html/{title}/{revision}
headers:
cache-control: '{{cache-control}}'
if-unmodified-since: '{{if-unmodified-since}}'
Expand Down Expand Up @@ -579,6 +587,17 @@ paths:
Example: `sr-el` for Latin transcription of the Serbian language.
required: false
type: string
x-request-handler:
- get_from_backend:
request:
uri: /{domain}/sys/parsoid/html/{title}/{revision}/{tid}
headers:
cache-control: '{{cache-control}}'
if-unmodified-since: '{{if-unmodified-since}}'
x-restbase-mode: '{{x-restbase-mode}}'
x-restbase-parentrevision: '{{x-restbase-parentrevision}}'
query:
sections: '{{sections}}'

/data-parsoid/{title}/{revision}/{tid}:
x-route-filters:
Expand Down Expand Up @@ -674,7 +693,7 @@ paths:
x-request-handler:
- get_from_backend:
request:
uri: /{domain}/sys/parsoid/data-parsoid/{title}/{revision}{/tid}
uri: /{domain}/sys/parsoid/data-parsoid/{title}/{revision}/{tid}
headers:
cache-control: '{{cache-control}}'
if-unmodified-since: '{{if-unmodified-since}}'
Expand Down Expand Up @@ -745,7 +764,7 @@ paths:
x-request-handler:
- get_from_backend:
request:
uri: /{domain}/sys/parsoid/lint/{title}{/revision}
uri: /{domain}/sys/parsoid/lint/{title}
x-monitor: false

/lint/{title}/{revision}:
Expand All @@ -764,6 +783,10 @@ paths:
description: The revision
type: integer
required: true
x-request-handler:
- get_from_backend:
request:
uri: /{domain}/sys/parsoid/lint/{title}/{revision}

/wikitext/{title}:
post:
Expand Down

0 comments on commit 982e38c

Please sign in to comment.