message: make sure required properties stay required
diff: @@ -84,6 +84,12 @@ export class SubsetSchemaDeduplicator extends Transformer<any, oai.Model> {
  const supersetEquivSchema = getSupersetSchema(filteredAnotherSchema, filteredCurrentSchema, additiveFieldsList, subsetRelation, `#/components/schemas/${anotherSchema.uid}`);
  const subsetEquivSchema = getSubsetSchema(filteredAnotherSchema, subsetRelation);
  + // gs: added -- ensure that properties left beg
  + if (currentSchema.value.required) {
  + const sesNames = Object.getOwnPropertyNames(supersetEquivSchema.properties);
  + supersetEquivSchema.required = currentSchema.value.required.filter(each => sesNames.indexOf(each) > - 1);
  + }
  +
  // replace with equivalent schema and put back metadata.
  currentSchema.value = { 'x-ms-metadata': metadataCurrentSchema, ...supersetEquivSchema };
  anotherSchema.value = { 'x-ms-metadata': metadataAnotherSchema, ...subsetEquivSchema };
  