openapi: Fix allOf usage to conform to the OpenAPI specification.
openapi: Fix allOf usage to conform to the OpenAPI specification.

yamole preprocesses our schema by naïvely merging all the objects in
an allOf array together, but this fails to capture the meaning of
allOf according to the OpenAPI specification.  allOf is supposed to be
a strict logical intersection of each subschema interpreted
independently.  It does not combine their properties maps before
interpreting additionalProperties.  So according to the old definition
of JsonSuccess, every response is invalid:

allOf:
  - additionalProperties: false
    properties:
      result:
        type: string
  - required:
      - result
      - msg
    properties:
      msg:
        type: string

because the first subschema disallowed msg and the second subschema
required msg.

To fix this, whenever we use allOf for schema “inheritence”, the base
schema must not specify additionalProperties, and the child schema
must explicitly list all properties recursively inherited from the
base schema in any subschema that uses additionalProperties.

Fixes #16109.

Signed-off-by: Anders Kaseorg <dfdb7392591db597bc41cf266a9c3bc12a2706e5@zulip.com>

rht/zulip,punchagan/zulip,andersk/zulip,showell/zulip,hackerkid/zulip,andersk/zulip,eeshangarg/zulip,eeshangarg/zulip,zulip/zulip,rht/zulip,zulip/zulip,hackerkid/zulip,zulip/zulip,zulip/zulip,eeshangarg/zulip,punchagan/zulip,andersk/zulip,rht/zulip,rht/zulip,andersk/zulip,punchagan/zulip,hackerkid/zulip,kou/zulip,andersk/zulip,zulip/zulip,kou/zulip,showell/zulip,kou/zulip,hackerkid/zulip,showell/zulip,showell/zulip,punchagan/zulip,zulip/zulip,kou/zulip,rht/zulip,kou/zulip,eeshangarg/zulip,eeshangarg/zulip,hackerkid/zulip,punchagan/zulip,andersk/zulip,showell/zulip,punchagan/zulip,hackerkid/zulip,kou/zulip,punchagan/zulip,rht/zulip,rht/zulip,zulip/zulip,hackerkid/zulip,eeshangarg/zulip,showell/zulip,showell/zulip,eeshangarg/zulip,andersk/zulip,kou/zulip