File tree Expand file tree Collapse file tree
config/protobuf-schema-template Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6363 generate_release_notes : true
6464 files : |
6565 opensearch-protobufs-java.tar.gz
66- opensearch_protobufs-*-py3-none-any.whl
66+ dist/ opensearch_protobufs-*-py3-none-any.whl
6767 opensearch-protobufs-*.zip
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55## [ Unreleased]
66### Added
77- Publish opensearch-protos python package to PyPi. ([ #183 ] ( https://github.com/opensearch-project/opensearch-protobufs/pull/183 ) )
8+ - Proto Convertion tooling support null value ([ #189 ] ( https://github.com/opensearch-project/opensearch-protobufs/pull/189 ) )
89
910### Changed
1011- update ` score ` protobuf type ([ #179 ] ( https://github.com/opensearch-project/opensearch-protobufs/pull/179 ) )
Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ export class SchemaModifier {
2020 onSchemaProperty : ( schema ) => {
2121 this . deduplicateEnumValue ( schema )
2222 this . handleAdditionalPropertiesUndefined ( schema )
23+ this . convertNullTypeToNullValue ( schema )
2324 this . collapseOrMergeOneOfArray ( schema )
2425 } ,
2526 onSchema : ( schema , schemaName ) => {
2627 if ( ! schema || isReferenceObject ( schema ) ) return ;
2728 this . deduplicateEnumValue ( schema )
2829 this . handleAdditionalPropertiesUndefined ( schema )
30+ this . convertNullTypeToNullValue ( schema )
2931 this . handleOneOfConst ( schema , schemaName )
3032 this . collapseOrMergeOneOfArray ( schema )
3133 this . collapseOneOfObjectPropContainsTitleSchema ( schema )
@@ -333,4 +335,11 @@ export class SchemaModifier {
333335
334336 schema . enum = Array . from ( enumSet )
335337 }
338+
339+ // Converts type: "null" to type: NullValue for protobuf compatibility
340+ convertNullTypeToNullValue ( schema : OpenAPIV3 . SchemaObject ) : void {
341+ if ( ( schema . type as any ) === 'null' ) {
342+ ( schema as any ) . type = 'NullValue' ;
343+ }
344+ }
336345}
Original file line number Diff line number Diff line change @@ -30,3 +30,8 @@ message GeneralNumber {
3030 double double_value = 4;
3131 }
3232}
33+
34+ enum NullValue {
35+ NULL_VALUE_UNSPECIFIED = 0;
36+ NULL_VALUE_NULL = 1;
37+ }
You can’t perform that action at this time.
0 commit comments