Skip to content

Commit

Permalink
fix(openapi): remove dedicated components files as we need to generat…
Browse files Browse the repository at this point in the history
…e it automaticaly
  • Loading branch information
rolljee committed Jan 31, 2024
1 parent 7a4d224 commit a3036f6
Show file tree
Hide file tree
Showing 23 changed files with 3 additions and 1,033 deletions.
29 changes: 0 additions & 29 deletions lib/api/httpRoutes.js
Expand Up @@ -23,22 +23,6 @@

"use strict";

const {
OpenApiDocumentCount,
OpenApiDocumentDeleteByQuery,
OpenApiDocumentDelete,
OpenApiDocumentScroll,
OpenApiDocumentExists,
OpenApiDocumentUpdate,
OpenApiDocumentReplace,
OpenApiDocumentGet,
OpenApiDocumentCreate,
OpenApiDocumentCreateOrReplace,
OpenApiDocumentValidate,
OpenApiSecurityUpsertUser,
OpenApiDocumentmCreateOrReplace,
} = require("./openapi/components");

const routes = [
// GET (idempotent)
{ verb: "get", path: "/_me", controller: "auth", action: "getCurrentUser" },
Expand Down Expand Up @@ -242,7 +226,6 @@ const routes = [
path: "/:index/:collection/:_id",
controller: "document",
action: "get",
openapi: OpenApiDocumentGet,
},
{
verb: "get",
Expand All @@ -255,7 +238,6 @@ const routes = [
path: "/:index/:collection/:_id/_exists",
controller: "document",
action: "exists",
openapi: OpenApiDocumentExists,
},
{
verb: "post",
Expand All @@ -268,7 +250,6 @@ const routes = [
path: "/_scroll/:scrollId",
controller: "document",
action: "scroll",
openapi: OpenApiDocumentScroll,
},

{
Expand Down Expand Up @@ -770,14 +751,12 @@ const routes = [
path: "/:index/:collection/_count",
controller: "document",
action: "count",
openapi: OpenApiDocumentCount,
},
{
verb: "post",
path: "/:index/:collection/_create",
controller: "document",
action: "create",
openapi: OpenApiDocumentCreate,
},
{
verb: "post",
Expand Down Expand Up @@ -832,7 +811,6 @@ const routes = [
path: "/:index/:collection/_validate",
controller: "document",
action: "validate",
openapi: OpenApiDocumentValidate,
},

{
Expand Down Expand Up @@ -955,7 +933,6 @@ const routes = [
path: "/users/:_id/_upsert",
controller: "security",
action: "upsertUser",
openapi: OpenApiSecurityUpsertUser,
},
{
verb: "post",
Expand Down Expand Up @@ -1241,7 +1218,6 @@ const routes = [
path: "/:index/:collection/:_id",
controller: "document",
action: "delete",
openapi: OpenApiDocumentDelete,
},
{
verb: "delete",
Expand All @@ -1254,7 +1230,6 @@ const routes = [
path: "/:index/:collection/_query",
controller: "document",
action: "deleteByQuery",
openapi: OpenApiDocumentDeleteByQuery,
},
{
verb: "delete",
Expand Down Expand Up @@ -1421,21 +1396,18 @@ const routes = [
path: "/:index/:collection/:_id",
controller: "document",
action: "createOrReplace",
openapi: OpenApiDocumentCreateOrReplace,
},
{
verb: "put",
path: "/:index/:collection/_mCreateOrReplace",
controller: "document",
action: "mCreateOrReplace",
openapi: OpenApiDocumentmCreateOrReplace,
},
{
verb: "put",
path: "/:index/:collection/:_id/_replace",
controller: "document",
action: "replace",
openapi: OpenApiDocumentReplace,
},
{
verb: "put",
Expand All @@ -1458,7 +1430,6 @@ const routes = [
path: "/:index/:collection/:_id/_update",
controller: "document",
action: "update",
openapi: OpenApiDocumentUpdate,
deprecated: {
since: "2.11.0",
message: 'Use "document:update" route with PATCH instead of PUT',
Expand Down
48 changes: 0 additions & 48 deletions lib/api/openapi/OpenApiManager.ts
Expand Up @@ -19,22 +19,6 @@
* limitations under the License.
*/

import {
OpenApiPayloadsDefinitions,
OpenApiDocumentCountComponent,
OpenApiDocumentDeleteByQueryComponent,
OpenApiDocumentDeleteComponent,
OpenApiDocumentScrollComponent,
OpenApiDocumentExistsComponent,
OpenApiDocumentUpdateComponent,
OpenApiDocumentReplaceComponent,
OpenApiDocumentGetComponent,
OpenApiDocumentCreateOrReplaceComponent,
OpenApiDocumentCreateComponent,
OpenApiDocumentValidateComponent,
OpenApiSecurityUpsertUserComponent,
OpenApiDocumentmCreateOrReplaceComponent,
} from "./components";
import { OpenApiDefinition } from "../../types/OpenApiDefinition";
import { version } from "../../../package.json";
import { generateOpenApi } from "./openApiGenerator";
Expand All @@ -50,7 +34,6 @@ export class OpenApiManager {
name: "Kuzzle team",
url: "https://kuzzle.io",
email: "support@kuzzle.io",
discord: "http://join.discord.kuzzle.io",
},
license: {
name: "Apache 2",
Expand All @@ -62,40 +45,9 @@ export class OpenApiManager {
description: "Kuzzle API Documentation",
url: "https://docs.kuzzle.io/core/2/api/",
},
servers: [
{
url: "https://{baseUrl}:{port}",
description: "Kuzzle Base Url",
variables: {
baseUrl: { default: "localhost" },
port: { default: 7512 },
},
},
],
tags: [],
schemes: ["https", "http"],
paths: {},
components: {
...OpenApiPayloadsDefinitions,

document: {
...OpenApiDocumentCountComponent,
...OpenApiDocumentDeleteByQueryComponent,
...OpenApiDocumentDeleteComponent,
...OpenApiDocumentScrollComponent,
...OpenApiDocumentExistsComponent,
...OpenApiDocumentUpdateComponent,
...OpenApiDocumentReplaceComponent,
...OpenApiDocumentGetComponent,
...OpenApiDocumentCreateOrReplaceComponent,
...OpenApiDocumentCreateComponent,
...OpenApiDocumentValidateComponent,
},
security: {
...OpenApiSecurityUpsertUserComponent,
...OpenApiDocumentmCreateOrReplaceComponent,
},
},
};
/* eslint-enable sort-keys */

Expand Down
47 changes: 0 additions & 47 deletions lib/api/openapi/components/document/count.yaml

This file was deleted.

46 changes: 0 additions & 46 deletions lib/api/openapi/components/document/create.yaml

This file was deleted.

61 changes: 0 additions & 61 deletions lib/api/openapi/components/document/createOrReplace.yaml

This file was deleted.

0 comments on commit a3036f6

Please sign in to comment.