mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add registration/complete route, fix some other tests
This commit is contained in:
@@ -123,6 +123,8 @@ paths:
|
||||
$ref: 'read/admin/advanced/errors/export.yaml'
|
||||
/api/admin/advanced/cache:
|
||||
$ref: 'read/admin/advanced/cache.yaml'
|
||||
/api/admin/advanced/cache/dump:
|
||||
$ref: 'read/admin/advanced/cache.yaml' # todo: @baris to fix, see gh#9122
|
||||
/api/admin/development/logger:
|
||||
$ref: 'read/admin/development/logger.yaml'
|
||||
/api/admin/development/info:
|
||||
@@ -165,11 +167,11 @@ paths:
|
||||
$ref: 'read/user/uid/userslug/export/uploads.yaml'
|
||||
"/api/user/uid/{userslug}/export/profile":
|
||||
$ref: 'read/user/uid/userslug/export/profile.yaml'
|
||||
"/api/post/pid/{id}":
|
||||
"/api/{type}/pid/{id}":
|
||||
$ref: 'read/post/pid/id.yaml'
|
||||
"/api/topic/tid/{id}":
|
||||
"/api/{type}/tid/{id}":
|
||||
$ref: 'read/topic/tid/id.yaml'
|
||||
"/api/category/cid/{id}":
|
||||
"/api/{type}/cid/{id}":
|
||||
$ref: 'read/category/cid/id.yaml'
|
||||
/api/categories:
|
||||
$ref: 'read/categories.yaml'
|
||||
@@ -197,6 +199,8 @@ paths:
|
||||
$ref: 'read/login.yaml'
|
||||
/api/register:
|
||||
$ref: 'read/register.yaml'
|
||||
/api/register/complete:
|
||||
$ref: 'read/register/complete.yaml'
|
||||
/api/search:
|
||||
$ref: 'read/search.yaml'
|
||||
"/api/reset":
|
||||
|
||||
@@ -54,28 +54,4 @@ get:
|
||||
title:
|
||||
type: string
|
||||
- $ref: ../components/schemas/Breadcrumbs.yaml#/Breadcrumbs
|
||||
- $ref: ../components/schemas/CommonProps.yaml#/CommonProps
|
||||
# /api/register/complete:
|
||||
# get:
|
||||
# tags:
|
||||
# - authentication
|
||||
# summary: /api/register/complete
|
||||
# responses:
|
||||
# "200":
|
||||
# description: ""
|
||||
# content:
|
||||
# application/json:
|
||||
# schema:
|
||||
# allOf:
|
||||
# - type: object
|
||||
# properties:
|
||||
# title:
|
||||
# type: string
|
||||
# errors:
|
||||
# type: array
|
||||
# items: {}
|
||||
# sections:
|
||||
# type: array
|
||||
# items:
|
||||
# type: string
|
||||
# - $ref: ../components/schemas/CommonProps.yaml#/CommonProps
|
||||
- $ref: ../components/schemas/CommonProps.yaml#/CommonProps
|
||||
23
public/openapi/read/register/complete.yaml
Normal file
23
public/openapi/read/register/complete.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
get:
|
||||
tags:
|
||||
- authentication
|
||||
summary: /api/register/complete
|
||||
responses:
|
||||
"200":
|
||||
description: ""
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
allOf:
|
||||
- type: object
|
||||
properties:
|
||||
title:
|
||||
type: string
|
||||
errors:
|
||||
type: array
|
||||
items: {}
|
||||
sections:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
- $ref: ../../components/schemas/CommonProps.yaml#/CommonProps
|
||||
@@ -212,6 +212,12 @@ describe('API', async () => {
|
||||
schema = writeApi;
|
||||
pathObj.path = pathObj.path.replace('/api/v3', '');
|
||||
}
|
||||
|
||||
// Don't check non-GET routes in Read API
|
||||
if (schema === readApi && pathObj.method !== 'get') {
|
||||
return;
|
||||
}
|
||||
|
||||
const normalizedPath = pathObj.path.replace(/\/:([^\\/]+)/g, '/{$1}').replace(/\?/g, '');
|
||||
assert(schema.paths.hasOwnProperty(normalizedPath));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user