forked from opensearch-project/opensearch-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve code generation (opensearch-project#1219)
- Render descriptions using markdown - Support generating "DictionaryResponse" types - Support discriminated unions Signed-off-by: Thomas Farr <[email protected]> (cherry picked from commit d045d86)
- Loading branch information
Showing
62 changed files
with
1,355 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
java-codegen/src/main/java/org/opensearch/client/codegen/model/DictionaryResponseShape.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.client.codegen.model; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
public class DictionaryResponseShape extends Shape { | ||
private final Type keyType; | ||
private final Type valueType; | ||
|
||
public DictionaryResponseShape( | ||
Namespace parent, | ||
String className, | ||
String typedefName, | ||
String description, | ||
Type keyType, | ||
Type valueType | ||
) { | ||
super(parent, className, typedefName, description); | ||
this.keyType = keyType; | ||
this.valueType = valueType; | ||
setExtendsType(Types.Client.Transport.Endpoints.DictionaryResponse(keyType, valueType)); | ||
} | ||
|
||
@Override | ||
public Collection<Type> getAnnotations() { | ||
return List.of(Types.Client.Json.JsonpDeserializable); | ||
} | ||
|
||
@Override | ||
public boolean extendsOtherShape() { | ||
return true; | ||
} | ||
} |
Oops, something went wrong.