MCPcopy Create free account
hub / github.com/parse-community/parse-server / createSchema

Function createSchema

src/Routers/SchemasRouter.js:73–94  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

71};
72
73async function createSchema(req) {
74 checkIfDefinedSchemasIsUsed(req);
75 if (req.auth.isReadOnly) {
76 throw createSanitizedError(
77 Parse.Error.OPERATION_FORBIDDEN,
78 "read-only masterKey isn't allowed to create a schema.",
79 req.config
80 );
81 }
82 if (req.params.className && req.body?.className) {
83 if (req.params.className != req.body.className) {
84 return classNameMismatchResponse(req.body.className, req.params.className);
85 }
86 }
87
88 const className = req.params.className || req.body?.className;
89 if (!className) {
90 throw new Parse.Error(135, `POST ${req.path} needs a class name.`);
91 }
92
93 return await internalCreateSchema(className, req.body || {}, req.config);
94}
95
96function modifySchema(req) {
97 checkIfDefinedSchemasIsUsed(req);

Callers

nothing calls this directly

Calls 4

createSanitizedErrorFunction · 0.90
internalCreateSchemaFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…