module.exports = function(schema) {
    const promise = require('bluebird');

    return {
        defineCreateExperimentSchema,
        defineUpdateExperimentSchema,
        defineCreateExperimentStepSchema,
        defineUpdateExperimentStepSchema
    };

    function defineCreateExperimentSchema() {
        let createExperimentSchema = schema.defineSchema('CreateExperiment', {
            project_id: {
                type: 'string',
                nullable: false
            },

            name: {
                type: 'string',
                nullable: false
            },

            aim: {
                type: 'string',
                nullable: false
            },

            goal: {
                type: 'string',
                nullable: false
            },

            status: {
                type: 'string',
                nullable: false,
                isValidExperimentStatus: true
            },

            description: {
                type: 'string'
            }
        });

        createExperimentSchema.setDefaults({
            aim: '',
            goal: '',
            description: '',
            status: 'active'
        });
        createExperimentSchema.validateAsync = promise.promisify(createExperimentSchema.validate);
        return createExperimentSchema;
    }

    function defineUpdateExperimentSchema() {
        let updateExperimentSchema = schema.defineSchema('UpdateExperiment', {
            name: {
                type: 'string',
                nullable: true
            },

            description: {
                type: 'string',
                nullable: true
            },

            notes: {
                type: 'string',
                nullable: true
            },

            steps: {
                type: 'array'
            }
        });
        updateExperimentSchema.setDefaults({steps: []});
        updateExperimentSchema.validateAsync = promise.promisify(updateExperimentSchema.validate);
        return updateExperimentSchema;
    }

    function defineCreateExperimentStepSchema() {
        let createExperimentStepSchema = schema.defineSchema('CreateExperimentStep', {
            name: {
                type: 'string',
                nullable: false
            },
            description: {
                type: 'string',
                nullable: false
            },
            parent_id: {
                type: 'string',
                nullable: false
            }
        });

        createExperimentStepSchema.setDefaults({parent_id: '', description: ''});
        createExperimentStepSchema.validateAsync = promise.promisify(createExperimentStepSchema.validate);
        return createExperimentStepSchema;
    }

    function defineUpdateExperimentStepSchema() {
        let updateExperimentStepSchema = schema.defineSchema('UpdateExperimentStep', {
            name: {
                type: 'string',
                nullable: true
            },
            description: {
                type: 'string',
                nullable: true
            },
            notes: {
                type: 'string',
                nullable: true
            },
            parent_id: {
                type: 'string',
                nullable: true
            },
            flags: {
                nullable: true,
                done: {
                    type: 'boolean',
                    nullable: true
                },
                important: {
                    type: 'boolean',
                    nullable: true
                },
                error: {
                    type: 'boolean',
                    nullable: true
                },
                review: {
                    type: 'boolean',
                    nullable: true
                }
            },
            steps: {
                type: 'array'
            }
        });

        updateExperimentStepSchema.setDefaults({steps: []});
        updateExperimentStepSchema.validateAsync = promise.promisify(updateExperimentStepSchema.validate);
        return updateExperimentStepSchema;
    }
};
@@ -1737,34 +1737,32 @@
 ue%0A            %7D
-,%0A
 %0A            ste
@@ -1758,130 +1758,8 @@
     
-    steps: %7B%0A                type: 'array'%0A            %7D%0A        %7D);%0A        updateExperimentSchema.setDefaults(%7Bsteps: %5B%5D
 %7D);%0A
@@ -3666,74 +3666,8 @@
   %7D%0A
-            %7D,%0A            steps: %7B%0A                type: 'array'%0A
     
@@ -3741,17 +3741,21 @@
 ts(%7B
-steps: %5B%5D
+parent_id: ''
 %7D);%0A

Add schema for updating a step. Remove the steps field from update experiment and update experiment step.