{"id":360587,"date":"2024-05-21T00:56:11","date_gmt":"2024-05-21T00:56:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=360587"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=360587","title":{"rendered":"<span>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 OpenApi \u0438\u043b\u0438 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 API first: oneOf, anyOf, allOf<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/770528\/\" rel=\"noopener noreferrer nofollow\">\u0417\u0434\u0435\u0441\u044c<\/a> \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<br \/>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c\u0430 openapi. <a href=\"https:\/\/spec.openapis.org\/oas\/v3.1.0#composition-and-inheritance-polymorphism\" rel=\"noopener noreferrer nofollow\">\u0417\u0434\u0435\u0441\u044c<\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. <\/p>\n<h2>1. \u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/h2>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u0431\u0443\u0434\u0443\u0442 \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<h3>2. discriminator<\/h3>\n<p><a href=\"https:\/\/spec.openapis.org\/oas\/v3.1.0#discriminator-object\" rel=\"noopener noreferrer nofollow\">\u0417\u0434\u0435\u0441\u044c<\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440 \u0432 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 openapi. \u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 &#8212; \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440 \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430 \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u0434\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c\u0430 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445, \u0431\u0435\u0437 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441 \u043d\u0438\u043c\u0438.<\/p>\n<h4>3.1 OneOf \u0431\u0435\u0437 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/d3f9fb789ccf4cabf52ad8320760c8c3dfc94eed\/src\/main\/resources\/api.yaml#L11\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<pre><code>    OneOfObjectWithoutDiscriminator:       oneOf:         - $ref: '#\/components\/schemas\/OneOfObjectWithoutDiscriminatorFirstProperty'         - $ref: '#\/components\/schemas\/OneOfObjectWithoutDiscriminatorSecondProperty'     OneOfObjectWithoutDiscriminatorFirstProperty:       type: object       required:         - someProperty       properties:         someProperty:           type: string     OneOfObjectWithoutDiscriminatorSecondProperty:       type: object       required:         - anotherProperty       properties:         anotherProperty:           type: string<\/code><\/pre>\n<p> \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u043b\u0435\u0436\u0430\u0442\u044c \u0434\u0432\u0430 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044f. \u0427\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438: <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithoutDiscriminator.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithoutDiscriminator<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithoutDiscriminatorFirstProperty.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithoutDiscriminatorFirstProperty<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithoutDiscriminatorSecondProperty.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithoutDiscriminatorSecondProperty<\/a><\/p>\n<pre><code>@Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public interface OneOfObjectWithoutDiscriminator { }<\/code><\/pre>\n<pre><code>\/**  * OneOfObjectWithoutDiscriminatorFirstProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class OneOfObjectWithoutDiscriminatorFirstProperty implements OneOfObjectWithoutDiscriminator {    private String someProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * OneOfObjectWithoutDiscriminatorSecondProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class OneOfObjectWithoutDiscriminatorSecondProperty implements OneOfObjectWithoutDiscriminator {    private String anotherProperty;  ...<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u043c\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 json.<\/p>\n<h4>3.2 OneOf \u0441 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c<\/h4>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/d3f9fb789ccf4cabf52ad8320760c8c3dfc94eed\/src\/main\/resources\/api.yaml#L68\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<pre><code>OneOfObjectWithDiscriminator:       oneOf:         - $ref: '#\/components\/schemas\/OneOfObjectWithDiscriminatorFirstProperty'         - $ref: '#\/components\/schemas\/OneOfObjectWithDiscriminatorSecondProperty'       discriminator:         propertyName: propertyType         mapping:           first: '#OneOfObjectWithDiscriminatorFirstProperty'           second: '#OneOfObjectWithDiscriminatorSecondProperty'     OneOfObjectWithDiscriminatorFirstProperty:       type: object       required:         - propertyType         - someProperty       properties:         propertyType:           type: string         someProperty:           type: string     OneOfObjectWithDiscriminatorSecondProperty:       type: object       required:         - propertyType         - anotherProperty       properties:         propertyType:           type: string         anotherProperty:           type: string<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u0427\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438: <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithDiscriminator.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithDiscriminator<\/a>,  <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithDiscriminatorFirstProperty.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithDiscriminatorFirstProperty<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithDiscriminatorSecondProperty.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithDiscriminatorSecondProperty<\/a><\/p>\n<pre><code>@JsonIgnoreProperties(   value = \"propertyType\", \/\/ ignore manually set propertyType, it will be automatically generated by Jackson during serialization   allowSetters = true \/\/ allows the propertyType to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = \"propertyType\", visible = true) @JsonSubTypes({   @JsonSubTypes.Type(value = OneOfObjectWithDiscriminatorFirstProperty.class, name = \"first\"),   @JsonSubTypes.Type(value = OneOfObjectWithDiscriminatorSecondProperty.class, name = \"second\"),   @JsonSubTypes.Type(value = OneOfObjectWithDiscriminatorFirstProperty.class, name = \"OneOfObjectWithDiscriminatorFirstProperty\"),   @JsonSubTypes.Type(value = OneOfObjectWithDiscriminatorSecondProperty.class, name = \"OneOfObjectWithDiscriminatorSecondProperty\") })  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public interface OneOfObjectWithDiscriminator {     public String getPropertyType(); }<\/code><\/pre>\n<pre><code>\/**  * OneOfObjectWithDiscriminatorFirstProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class OneOfObjectWithDiscriminatorFirstProperty implements OneOfObjectWithDiscriminator {    private String propertyType;    private String someProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * OneOfObjectWithDiscriminatorSecondProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class OneOfObjectWithDiscriminatorSecondProperty implements OneOfObjectWithDiscriminator {    private String propertyType;    private String anotherProperty;  ...<\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0431\u0432\u044f\u0437\u043a\u0430 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 JsonSubTypes. \u0422\u0430\u043a\u0443\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043c\u044b \u0443\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<h4>4.1 AllOf \u0431\u0435\u0437 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/d3f9fb789ccf4cabf52ad8320760c8c3dfc94eed\/src\/main\/resources\/api.yaml#L30C5-L30C5\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<pre><code>AllOfObjectWithoutDiscriminator:       allOf:         - $ref: '#\/components\/schemas\/AllOfObjectWithoutDiscriminatorFirstProperty'         - $ref: '#\/components\/schemas\/AllOfObjectWithoutDiscriminatorSecondProperty'     AllOfObjectWithoutDiscriminatorFirstProperty:       type: object       required:         - someProperty       properties:         someProperty:           type: string     AllOfObjectWithoutDiscriminatorSecondProperty:       type: object       required:         - anotherProperty       properties:         anotherProperty:           type: string<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438: <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithoutDiscriminator.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithoutDiscriminator<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithoutDiscriminatorFirstProperty.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithoutDiscriminatorFirstProperty<\/a>,  <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithoutDiscriminatorSecondProperty.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithoutDiscriminatorSecondProperty<\/a><\/p>\n<pre><code>\/**  * AllOfObjectWithoutDiscriminator  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AllOfObjectWithoutDiscriminator {    private String someProperty;    private String anotherProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AllOfObjectWithoutDiscriminatorFirstProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AllOfObjectWithoutDiscriminatorFirstProperty {    private String someProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AllOfObjectWithoutDiscriminatorSecondProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AllOfObjectWithoutDiscriminatorSecondProperty {    private String anotherProperty;  ...<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e AllOfObjectWithoutDiscriminator \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u0430 \u043f\u043e\u043b\u044f \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 allOf \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h4>4.2 AllOf \u0441 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c<\/h4>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/d3f9fb789ccf4cabf52ad8320760c8c3dfc94eed\/src\/main\/resources\/api.yaml#L98\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<pre><code>AllOfObjectWithDiscriminator:       allOf:         - $ref: '#\/components\/schemas\/AllOfObjectWithDiscriminatorFirstProperty'         - $ref: '#\/components\/schemas\/AllOfObjectWithDiscriminatorSecondProperty'       discriminator:         propertyName: propertyType         mapping:           first: '#AllOfObjectWithDiscriminatorFirstProperty'           second: '#AllOfObjectWithDiscriminatorSecondProperty'     AllOfObjectWithDiscriminatorFirstProperty:       type: object       required:         - propertyType         - someProperty       properties:         propertyType:           type: string         someProperty:           type: string     AllOfObjectWithDiscriminatorSecondProperty:       type: object       required:         - propertyType         - anotherProperty       properties:         propertyType:           type: string         anotherProperty:           type: string<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438: <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithDiscriminator.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithDiscriminator<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithDiscriminatorFirstProperty.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithDiscriminatorFirstProperty<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithDiscriminatorSecondProperty.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithDiscriminatorSecondProperty<\/a>  <\/p>\n<pre><code>\/**  * AllOfObjectWithDiscriminator  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor   @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AllOfObjectWithDiscriminator {    private String propertyType;    private String someProperty;    private String anotherProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AllOfObjectWithDiscriminatorFirstProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AllOfObjectWithDiscriminatorFirstProperty {    private String propertyType;    private String someProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AllOfObjectWithDiscriminatorSecondProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AllOfObjectWithDiscriminatorSecondProperty {    private String propertyType;    private String anotherProperty;  ...<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0435\u0437 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 allOf, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 openapi, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0442\u0435\u043c, \u0442\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c. <\/p>\n<h4>5.1 AnyOf \u0431\u0435\u0437 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/d3f9fb789ccf4cabf52ad8320760c8c3dfc94eed\/src\/main\/resources\/api.yaml#L49\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<pre><code>AnyOfObjectWithoutDiscriminator:       anyOf:         - $ref: '#\/components\/schemas\/AnyOfObjectWithoutDiscriminatorFirstProperty'         - $ref: '#\/components\/schemas\/AnyOfObjectWithoutDiscriminatorSecondProperty'     AnyOfObjectWithoutDiscriminatorFirstProperty:       type: object       required:         - someProperty       properties:         someProperty:           type: string     AnyOfObjectWithoutDiscriminatorSecondProperty:       type: object       required:         - anotherProperty       properties:         anotherProperty:           type: string<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438: <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AnyOfObjectWithoutDiscriminator.java\" rel=\"noopener noreferrer nofollow\">AnyOfObjectWithoutDiscriminator<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AnyOfObjectWithoutDiscriminatorFirstProperty.java\" rel=\"noopener noreferrer nofollow\">AnyOfObjectWithoutDiscriminatorFirstProperty<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AnyOfObjectWithoutDiscriminatorSecondProperty.java\" rel=\"noopener noreferrer nofollow\">AnyOfObjectWithoutDiscriminatorSecondProperty<\/a><\/p>\n<pre><code>\/**  * AnyOfObjectWithoutDiscriminator  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AnyOfObjectWithoutDiscriminator {    private String someProperty;    private String anotherProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AnyOfObjectWithoutDiscriminatorFirstProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AnyOfObjectWithoutDiscriminatorFirstProperty {    private String someProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AnyOfObjectWithoutDiscriminatorSecondProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AnyOfObjectWithoutDiscriminatorSecondProperty {    private String anotherProperty;  ...<\/code><\/pre>\n<h4>5.2 AnyOf \u0441 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c<\/h4>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/d3f9fb789ccf4cabf52ad8320760c8c3dfc94eed\/src\/main\/resources\/api.yaml#L128\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<pre><code>AnyOfObjectWithDiscriminator:       anyOf:         - $ref: '#\/components\/schemas\/AnyOfObjectWithDiscriminatorFirstProperty'         - $ref: '#\/components\/schemas\/AnyOfObjectWithDiscriminatorSecondProperty'       discriminator:         propertyName: PropertyType         mapping:           first: '#AnyOfObjectWithDiscriminatorFirstProperty'           second: '#AnyOfObjectWithDiscriminatorSecondProperty'     AnyOfObjectWithDiscriminatorFirstProperty:       type: object       required:         - propertyType         - someProperty       properties:         propertyType:           type: string         someProperty:           type: string     AnyOfObjectWithDiscriminatorSecondProperty:       type: object       required:         - propertyType         - anotherProperty       properties:         propertyType:           type: string         anotherProperty:           type: string<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438: <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AnyOfObjectWithDiscriminator.java\" rel=\"noopener noreferrer nofollow\">AnyOfObjectWithDiscriminator<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AnyOfObjectWithDiscriminatorFirstProperty.java\" rel=\"noopener noreferrer nofollow\">AnyOfObjectWithDiscriminatorFirstProperty<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AnyOfObjectWithDiscriminatorSecondProperty.java\" rel=\"noopener noreferrer nofollow\">AnyOfObjectWithDiscriminatorSecondProperty<\/a><\/p>\n<pre><code>\/**  * AnyOfObjectWithDiscriminator  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @JsonIgnoreProperties(   value = \"PropertyType\", \/\/ ignore manually set PropertyType, it will be automatically generated by Jackson during serialization   allowSetters = true \/\/ allows the PropertyType to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = \"PropertyType\", visible = true) @JsonSubTypes({   @JsonSubTypes.Type(value = AnyOfObjectWithDiscriminatorFirstProperty.class, name = \"first\"),   @JsonSubTypes.Type(value = AnyOfObjectWithDiscriminatorSecondProperty.class, name = \"second\"),   @JsonSubTypes.Type(value = AnyOfObjectWithDiscriminatorFirstProperty.class, name = \"AnyOfObjectWithDiscriminatorFirstProperty\"),   @JsonSubTypes.Type(value = AnyOfObjectWithDiscriminatorSecondProperty.class, name = \"AnyOfObjectWithDiscriminatorSecondProperty\") })  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AnyOfObjectWithDiscriminator {    private String propertyType;    private String someProperty;    private String anotherProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AnyOfObjectWithDiscriminatorFirstProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AnyOfObjectWithDiscriminatorFirstProperty {    private String propertyType;    private String someProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AnyOfObjectWithDiscriminatorSecondProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AnyOfObjectWithDiscriminatorSecondProperty {    private String propertyType;    private String anotherProperty;  ...<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0441 oneOf. \u041f\u0440\u0438 \u044d\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c oneOf, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442  \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a anyOf \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u043e \u0432\u0441\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432. <\/p>\n<h4>6. P.S.<\/h4>\n<p>AnyOf, AllOf, OneOf \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/774928\/\"> https:\/\/habr.com\/ru\/articles\/774928\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/770528\/\" rel=\"noopener noreferrer nofollow\">\u0417\u0434\u0435\u0441\u044c<\/a> \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<br \/>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c\u0430 openapi. <a href=\"https:\/\/spec.openapis.org\/oas\/v3.1.0#composition-and-inheritance-polymorphism\" rel=\"noopener noreferrer nofollow\">\u0417\u0434\u0435\u0441\u044c<\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. <\/p>\n<h2>1. \u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/h2>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u0431\u0443\u0434\u0443\u0442 \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<h3>2. discriminator<\/h3>\n<p><a href=\"https:\/\/spec.openapis.org\/oas\/v3.1.0#discriminator-object\" rel=\"noopener noreferrer nofollow\">\u0417\u0434\u0435\u0441\u044c<\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440 \u0432 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 openapi. \u0415\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 &#8212; \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440 \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430 \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u0434\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u0438\u043c\u043e\u0440\u0444\u0438\u0437\u043c\u0430 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445, \u0431\u0435\u0437 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441 \u043d\u0438\u043c\u0438.<\/p>\n<h4>3.1 OneOf \u0431\u0435\u0437 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/d3f9fb789ccf4cabf52ad8320760c8c3dfc94eed\/src\/main\/resources\/api.yaml#L11\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<pre><code>    OneOfObjectWithoutDiscriminator:       oneOf:         - $ref: '#\/components\/schemas\/OneOfObjectWithoutDiscriminatorFirstProperty'         - $ref: '#\/components\/schemas\/OneOfObjectWithoutDiscriminatorSecondProperty'     OneOfObjectWithoutDiscriminatorFirstProperty:       type: object       required:         - someProperty       properties:         someProperty:           type: string     OneOfObjectWithoutDiscriminatorSecondProperty:       type: object       required:         - anotherProperty       properties:         anotherProperty:           type: string<\/code><\/pre>\n<p> \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u043b\u0435\u0436\u0430\u0442\u044c \u0434\u0432\u0430 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044f. \u0427\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438: <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithoutDiscriminator.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithoutDiscriminator<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithoutDiscriminatorFirstProperty.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithoutDiscriminatorFirstProperty<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithoutDiscriminatorSecondProperty.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithoutDiscriminatorSecondProperty<\/a><\/p>\n<pre><code>@Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public interface OneOfObjectWithoutDiscriminator { }<\/code><\/pre>\n<pre><code>\/**  * OneOfObjectWithoutDiscriminatorFirstProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class OneOfObjectWithoutDiscriminatorFirstProperty implements OneOfObjectWithoutDiscriminator {    private String someProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * OneOfObjectWithoutDiscriminatorSecondProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class OneOfObjectWithoutDiscriminatorSecondProperty implements OneOfObjectWithoutDiscriminator {    private String anotherProperty;  ...<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u043c\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 json.<\/p>\n<h4>3.2 OneOf \u0441 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c<\/h4>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/d3f9fb789ccf4cabf52ad8320760c8c3dfc94eed\/src\/main\/resources\/api.yaml#L68\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<pre><code>OneOfObjectWithDiscriminator:       oneOf:         - $ref: '#\/components\/schemas\/OneOfObjectWithDiscriminatorFirstProperty'         - $ref: '#\/components\/schemas\/OneOfObjectWithDiscriminatorSecondProperty'       discriminator:         propertyName: propertyType         mapping:           first: '#OneOfObjectWithDiscriminatorFirstProperty'           second: '#OneOfObjectWithDiscriminatorSecondProperty'     OneOfObjectWithDiscriminatorFirstProperty:       type: object       required:         - propertyType         - someProperty       properties:         propertyType:           type: string         someProperty:           type: string     OneOfObjectWithDiscriminatorSecondProperty:       type: object       required:         - propertyType         - anotherProperty       properties:         propertyType:           type: string         anotherProperty:           type: string<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u0427\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438: <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithDiscriminator.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithDiscriminator<\/a>,  <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithDiscriminatorFirstProperty.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithDiscriminatorFirstProperty<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/OneOfObjectWithDiscriminatorSecondProperty.java\" rel=\"noopener noreferrer nofollow\">OneOfObjectWithDiscriminatorSecondProperty<\/a><\/p>\n<pre><code>@JsonIgnoreProperties(   value = \"propertyType\", \/\/ ignore manually set propertyType, it will be automatically generated by Jackson during serialization   allowSetters = true \/\/ allows the propertyType to be set during deserialization ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = \"propertyType\", visible = true) @JsonSubTypes({   @JsonSubTypes.Type(value = OneOfObjectWithDiscriminatorFirstProperty.class, name = \"first\"),   @JsonSubTypes.Type(value = OneOfObjectWithDiscriminatorSecondProperty.class, name = \"second\"),   @JsonSubTypes.Type(value = OneOfObjectWithDiscriminatorFirstProperty.class, name = \"OneOfObjectWithDiscriminatorFirstProperty\"),   @JsonSubTypes.Type(value = OneOfObjectWithDiscriminatorSecondProperty.class, name = \"OneOfObjectWithDiscriminatorSecondProperty\") })  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public interface OneOfObjectWithDiscriminator {     public String getPropertyType(); }<\/code><\/pre>\n<pre><code>\/**  * OneOfObjectWithDiscriminatorFirstProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class OneOfObjectWithDiscriminatorFirstProperty implements OneOfObjectWithDiscriminator {    private String propertyType;    private String someProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * OneOfObjectWithDiscriminatorSecondProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class OneOfObjectWithDiscriminatorSecondProperty implements OneOfObjectWithDiscriminator {    private String propertyType;    private String anotherProperty;  ...<\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0431\u0432\u044f\u0437\u043a\u0430 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 JsonSubTypes. \u0422\u0430\u043a\u0443\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043c\u044b \u0443\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<h4>4.1 AllOf \u0431\u0435\u0437 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/d3f9fb789ccf4cabf52ad8320760c8c3dfc94eed\/src\/main\/resources\/api.yaml#L30C5-L30C5\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<pre><code>AllOfObjectWithoutDiscriminator:       allOf:         - $ref: '#\/components\/schemas\/AllOfObjectWithoutDiscriminatorFirstProperty'         - $ref: '#\/components\/schemas\/AllOfObjectWithoutDiscriminatorSecondProperty'     AllOfObjectWithoutDiscriminatorFirstProperty:       type: object       required:         - someProperty       properties:         someProperty:           type: string     AllOfObjectWithoutDiscriminatorSecondProperty:       type: object       required:         - anotherProperty       properties:         anotherProperty:           type: string<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438: <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithoutDiscriminator.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithoutDiscriminator<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithoutDiscriminatorFirstProperty.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithoutDiscriminatorFirstProperty<\/a>,  <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithoutDiscriminatorSecondProperty.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithoutDiscriminatorSecondProperty<\/a><\/p>\n<pre><code>\/**  * AllOfObjectWithoutDiscriminator  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AllOfObjectWithoutDiscriminator {    private String someProperty;    private String anotherProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AllOfObjectWithoutDiscriminatorFirstProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AllOfObjectWithoutDiscriminatorFirstProperty {    private String someProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AllOfObjectWithoutDiscriminatorSecondProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AllOfObjectWithoutDiscriminatorSecondProperty {    private String anotherProperty;  ...<\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e AllOfObjectWithoutDiscriminator \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u0430 \u043f\u043e\u043b\u044f \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 allOf \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<h4>4.2 AllOf \u0441 \u0434\u0438\u0441\u043a\u0440\u0438\u043c\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c<\/h4>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/d3f9fb789ccf4cabf52ad8320760c8c3dfc94eed\/src\/main\/resources\/api.yaml#L98\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<pre><code>AllOfObjectWithDiscriminator:       allOf:         - $ref: '#\/components\/schemas\/AllOfObjectWithDiscriminatorFirstProperty'         - $ref: '#\/components\/schemas\/AllOfObjectWithDiscriminatorSecondProperty'       discriminator:         propertyName: propertyType         mapping:           first: '#AllOfObjectWithDiscriminatorFirstProperty'           second: '#AllOfObjectWithDiscriminatorSecondProperty'     AllOfObjectWithDiscriminatorFirstProperty:       type: object       required:         - propertyType         - someProperty       properties:         propertyType:           type: string         someProperty:           type: string     AllOfObjectWithDiscriminatorSecondProperty:       type: object       required:         - propertyType         - anotherProperty       properties:         propertyType:           type: string         anotherProperty:           type: string<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438: <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithDiscriminator.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithDiscriminator<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithDiscriminatorFirstProperty.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithDiscriminatorFirstProperty<\/a>, <a href=\"https:\/\/github.com\/SaintCheshire\/openapi-composition-and-inheritance\/blob\/main\/build\/generated\/saint\/cheshire\/specifications\/spring_boot_openapi_generation\/v1_0_0\/server\/model\/AllOfObjectWithDiscriminatorSecondProperty.java\" rel=\"noopener noreferrer nofollow\">AllOfObjectWithDiscriminatorSecondProperty<\/a>  <\/p>\n<pre><code>\/**  * AllOfObjectWithDiscriminator  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor   @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date = \"2023-11-19T15:45:21.742670500+03:00[Europe\/Moscow]\") public class AllOfObjectWithDiscriminator {    private String propertyType;    private String someProperty;    private String anotherProperty;  ...<\/code><\/pre>\n<pre><code>\/**  * AllOfObjectWithDiscriminatorFirstProperty  *\/ @lombok.Builder(toBuilder = true) @lombok.RequiredArgsConstructor @lombok.AllArgsConstructor  @Generated(value = \"org.openapitools.codegen.languages.SpringCodegen\", date =<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-360587","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/360587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=360587"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/360587\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=360587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=360587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=360587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}