@@ -44,7 +44,7 @@ public class OpenApiSchema : IOpenApiAnnotatable, IOpenApiExtensible, IOpenApiRe
4444        /// <summary> 
4545        /// $vocabulary- used in meta-schemas to identify the vocabularies available for use in schemas described by that meta-schema. 
4646        /// </summary> 
47-         public  virtual  string  Vocabulary  {  get ;  set ;  } 
47+         public  virtual  IDictionary < string ,   bool >  Vocabulary  {  get ;  set ;  } 
4848
4949        /// <summary> 
5050        /// $dynamicRef - an applicator that allows for deferring the full resolution until runtime, at which point it is resolved each time it is encountered while evaluating an instance 
@@ -56,16 +56,6 @@ public class OpenApiSchema : IOpenApiAnnotatable, IOpenApiExtensible, IOpenApiRe
5656        /// </summary> 
5757        public  virtual  string  DynamicAnchor  {  get ;  set ;  } 
5858
59-         /// <summary> 
60-         /// $recursiveAnchor - used to construct recursive schemas i.e one that has a reference to its own root, identified by the empty fragment URI reference ("#") 
61-         /// </summary> 
62-         public  virtual  string  RecursiveAnchor  {  get ;  set ;  } 
63- 
64-         /// <summary> 
65-         /// $recursiveRef - used to construct recursive schemas i.e one that has a reference to its own root, identified by the empty fragment URI reference ("#") 
66-         /// </summary> 
67-         public  virtual  string  RecursiveRef  {  get ;  set ;  } 
68- 
6959        /// <summary> 
7060        /// $defs - reserves a location for schema authors to inline re-usable JSON Schemas into a more general schema.  
7161        /// The keyword does not directly affect the validation result 
@@ -359,11 +349,9 @@ public OpenApiSchema(OpenApiSchema schema)
359349            Id  =  schema ? . Id  ??  Id ; 
360350            Schema  =  schema ? . Schema  ??  Schema ; 
361351            Comment  =  schema ? . Comment  ??  Comment ; 
362-             Vocabulary  =  schema ? . Vocabulary  ??   Vocabulary ; 
352+             Vocabulary  =  schema ? . Vocabulary  !=   null   ?   new   Dictionary < string ,   bool > ( schema . Vocabulary )   :   null ; 
363353            DynamicAnchor  =  schema ? . DynamicAnchor  ??  DynamicAnchor ; 
364354            DynamicRef  =  schema ? . DynamicRef  ??  DynamicRef ; 
365-             RecursiveAnchor  =  schema ? . RecursiveAnchor  ??  RecursiveAnchor ; 
366-             RecursiveRef  =  schema ? . RecursiveRef  ??  RecursiveRef ; 
367355            Definitions  =  schema ? . Definitions  !=  null  ?  new  Dictionary < string ,  OpenApiSchema > ( schema . Definitions )  :  null ; 
368356            UnevaluatedProperties  =  schema ? . UnevaluatedProperties  ??  UnevaluatedProperties ; 
369357            V31ExclusiveMaximum  =  schema ? . V31ExclusiveMaximum  ??  V31ExclusiveMaximum ; 
@@ -491,30 +479,30 @@ public void SerializeInternal(IOpenApiWriter writer, OpenApiSpecVersion version,
491479            SerializeTypeProperty ( Type ,  writer ,  version ) ; 
492480
493481            // allOf 
494-             writer . WriteOptionalCollection ( OpenApiConstants . AllOf ,  AllOf ,  ( w ,   s )   =>   s . SerializeAsV3 ( w ) ) ; 
482+             writer . WriteOptionalCollection ( OpenApiConstants . AllOf ,  AllOf ,  callback ) ; 
495483
496484            // anyOf 
497-             writer . WriteOptionalCollection ( OpenApiConstants . AnyOf ,  AnyOf ,  ( w ,   s )   =>   s . SerializeAsV3 ( w ) ) ; 
485+             writer . WriteOptionalCollection ( OpenApiConstants . AnyOf ,  AnyOf ,  callback ) ; 
498486
499487            // oneOf 
500-             writer . WriteOptionalCollection ( OpenApiConstants . OneOf ,  OneOf ,  ( w ,   s )   =>   s . SerializeAsV3 ( w ) ) ; 
488+             writer . WriteOptionalCollection ( OpenApiConstants . OneOf ,  OneOf ,  callback ) ; 
501489
502490            // not 
503-             writer . WriteOptionalObject ( OpenApiConstants . Not ,  Not ,  ( w ,   s )   =>   s . SerializeAsV3 ( w ) ) ; 
491+             writer . WriteOptionalObject ( OpenApiConstants . Not ,  Not ,  callback ) ; 
504492
505493            // items 
506-             writer . WriteOptionalObject ( OpenApiConstants . Items ,  Items ,  ( w ,   s )   =>   s . SerializeAsV3 ( w ) ) ; 
494+             writer . WriteOptionalObject ( OpenApiConstants . Items ,  Items ,  callback ) ; 
507495
508496            // properties 
509-             writer . WriteOptionalMap ( OpenApiConstants . Properties ,  Properties ,  ( w ,   s )   =>   s . SerializeAsV3 ( w ) ) ; 
497+             writer . WriteOptionalMap ( OpenApiConstants . Properties ,  Properties ,  callback ) ; 
510498
511499            // additionalProperties 
512500            if  ( AdditionalPropertiesAllowed ) 
513501            { 
514502                writer . WriteOptionalObject ( 
515503                    OpenApiConstants . AdditionalProperties , 
516504                    AdditionalProperties , 
517-                     ( w ,   s )   =>   s . SerializeAsV3 ( w ) ) ; 
505+                     callback ) ; 
518506            } 
519507            else 
520508            { 
@@ -537,7 +525,7 @@ public void SerializeInternal(IOpenApiWriter writer, OpenApiSpecVersion version,
537525            } 
538526
539527            // discriminator 
540-             writer . WriteOptionalObject ( OpenApiConstants . Discriminator ,  Discriminator ,  ( w ,   s )   =>   s . SerializeAsV3 ( w ) ) ; 
528+             writer . WriteOptionalObject ( OpenApiConstants . Discriminator ,  Discriminator ,  callback ) ; 
541529
542530            // readOnly 
543531            writer . WriteProperty ( OpenApiConstants . ReadOnly ,  ReadOnly ,  false ) ; 
@@ -549,7 +537,7 @@ public void SerializeInternal(IOpenApiWriter writer, OpenApiSpecVersion version,
549537            writer . WriteOptionalObject ( OpenApiConstants . Xml ,  Xml ,  ( w ,  s )  =>  s . SerializeAsV2 ( w ) ) ; 
550538
551539            // externalDocs 
552-             writer . WriteOptionalObject ( OpenApiConstants . ExternalDocs ,  ExternalDocs ,  ( w ,   s )   =>   s . SerializeAsV3 ( w ) ) ; 
540+             writer . WriteOptionalObject ( OpenApiConstants . ExternalDocs ,  ExternalDocs ,  callback ) ; 
553541
554542            // example 
555543            writer . WriteOptionalObject ( OpenApiConstants . Example ,  Example ,  ( w ,  e )  =>  w . WriteAny ( e ) ) ; 
@@ -558,7 +546,7 @@ public void SerializeInternal(IOpenApiWriter writer, OpenApiSpecVersion version,
558546            writer . WriteProperty ( OpenApiConstants . Deprecated ,  Deprecated ,  false ) ; 
559547
560548            // extensions 
561-             writer . WriteExtensions ( Extensions ,  OpenApiSpecVersion . OpenApi3_0 ) ; 
549+             writer . WriteExtensions ( Extensions ,  version ) ; 
562550
563551            writer . WriteEndObject ( ) ; 
564552        } 
@@ -575,12 +563,10 @@ internal void WriteV31Properties(IOpenApiWriter writer)
575563            writer . WriteProperty ( OpenApiConstants . Id ,  Id ) ; 
576564            writer . WriteProperty ( OpenApiConstants . DollarSchema ,  Schema ) ; 
577565            writer . WriteProperty ( OpenApiConstants . Comment ,  Comment ) ; 
578-             writer . WriteProperty ( OpenApiConstants . Vocabulary ,  Vocabulary ) ; 
579-             writer . WriteOptionalMap ( OpenApiConstants . Defs ,  Definitions ,  ( w ,  s )  =>  s . SerializeAsV3 ( w ) ) ; 
566+             writer . WriteOptionalMap ( OpenApiConstants . Vocabulary ,  Vocabulary ,   ( w ,   s )   =>   w . WriteValue ( s ) ) ; 
567+             writer . WriteOptionalMap ( OpenApiConstants . Defs ,  Definitions ,  ( w ,  s )  =>  s . SerializeAsV31 ( w ) ) ; 
580568            writer . WriteProperty ( OpenApiConstants . DynamicRef ,  DynamicRef ) ; 
581569            writer . WriteProperty ( OpenApiConstants . DynamicAnchor ,  DynamicAnchor ) ; 
582-             writer . WriteProperty ( OpenApiConstants . RecursiveAnchor ,  RecursiveAnchor ) ; 
583-             writer . WriteProperty ( OpenApiConstants . RecursiveRef ,  RecursiveRef ) ; 
584570            writer . WriteProperty ( OpenApiConstants . V31ExclusiveMaximum ,  V31ExclusiveMaximum ) ; 
585571            writer . WriteProperty ( OpenApiConstants . V31ExclusiveMinimum ,  V31ExclusiveMinimum ) ;             
586572            writer . WriteProperty ( OpenApiConstants . UnevaluatedProperties ,  UnevaluatedProperties ,  false ) ; 
0 commit comments