Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import org.yaml.snakeyaml.nodes.ScalarNode;
import org.yaml.snakeyaml.nodes.SequenceNode;

import java.util.ArrayList;
import java.util.List;

public class CodeModelCustomConstructor extends Constructor {
public CodeModelCustomConstructor() {
super();
Expand Down Expand Up @@ -124,6 +127,33 @@ public Object construct(Node node) {
case "schema": {
MappingNode value = (MappingNode) tuple.getValueNode();
value.setType(getSchemaTypeFromMappingNode(value));
break;
}
case "extensions": {
MappingNode value = (MappingNode) tuple.getValueNode();
List<NodeTuple> actualValues = new ArrayList<>();
for (NodeTuple extension : value.getValue()) {
ScalarNode keyNode = (ScalarNode) extension.getKeyNode();
if ("x-ms-pageable".equals(keyNode.getValue())) {
actualValues.add(new NodeTuple(new ScalarNode(
keyNode.getTag(),
"xmsPageable",
keyNode.getStartMark(),
keyNode.getEndMark(),
keyNode.getScalarStyle()),
extension.getValueNode()));
} else if ("x-ms-skip-url-encoding".equals(keyNode.getValue())) {
actualValues.add(new NodeTuple(new ScalarNode(
keyNode.getTag(),
"xmsSkipUrlEncoding",
keyNode.getStartMark(),
keyNode.getEndMark(),
keyNode.getScalarStyle()),
extension.getValueNode()));
}
}
value.setValue(actualValues);
break;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ public class Language {
/**
* name used in actual implementation
* (Required)
*
*
*/
private String name;

/**
* name used in serialization
* (Optional)
*
*/
private String serializedName;

/**
* description text - describes this node.
* (Required)
Expand All @@ -40,6 +48,14 @@ public void setName(String name) {
this.name = name;
}

public String getSerializedName() {
return serializedName;
}

public void setSerializedName(String serializedName) {
this.serializedName = serializedName;
}

/**
* description text - describes this node.
* (Required)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ public class XmsExtensions {

private String xmsClientName;

private XmsPageable xmsPageable;

private boolean xmsSkipUrlEncoding;

public XmsEnum getXmsEnum() {
return xmsEnum;
}
Expand All @@ -20,4 +24,20 @@ public String getXmsClientName() {
public void setXmsClientName(String xmsClientName) {
this.xmsClientName = xmsClientName;
}

public XmsPageable getXmsPageable() {
return xmsPageable;
}

public void setXmsPageable(XmsPageable xmsPageable) {
this.xmsPageable = xmsPageable;
}

public boolean isXmsSkipUrlEncoding() {
return xmsSkipUrlEncoding;
}

public void setXmsSkipUrlEncoding(boolean xmsSkipUrlEncoding) {
this.xmsSkipUrlEncoding = xmsSkipUrlEncoding;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.azure.autorest.extension.base.model.extensionmodel;

import com.azure.autorest.extension.base.model.codemodel.Operation;

public class XmsPageable {
private String itemName = "value";
private String nextLinkName;
private String operationName;
private Operation nextOperation;

public String getItemName() {
return itemName;
}

public void setItemName(String itemName) {
this.itemName = itemName;
}

public String getNextLinkName() {
return nextLinkName;
}

public void setNextLinkName(String nextLinkName) {
this.nextLinkName = nextLinkName;
}

public String getOperationName() {
return operationName;
}

public void setOperationName(String operationName) {
this.operationName = operationName;
}

public Operation getNextOperation() {
return nextOperation;
}

public void setNextOperation(Operation nextOperation) {
this.nextOperation = nextOperation;
}
}
3 changes: 2 additions & 1 deletion generate
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ autorest-beta --java --use:./ --input-file=https://raw.githubusercontent.com/Azu
autorest-beta --java --use:./ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-integer.json --namespace=fixtures.bodyinteger --output-folder=tests --sync-methods=all
autorest-beta --java --use:./ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-number.json --namespace=fixtures.bodynumber --output-folder=tests --sync-methods=all
autorest-beta --java --use:./ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/httpInfrastructure.json --namespace=fixtures.httpinfrastructure --output-folder=tests --sync-methods=all
autorest-beta --java --use:./ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/paging.json --namespace=fixtures.paging --output-folder=tests --sync-methods=all
autorest-beta --java --use:./ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-byte.json --namespace=fixtures.bodybyte --output-folder=tests --sync-methods=all
autorest-beta --java --use:./ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-date.json --namespace=fixtures.bodydate --output-folder=tests --sync-methods=all
autorest-beta --java --use:./ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-datetime.json --namespace=fixtures.bodydatetime --output-folder=tests --sync-methods=all
autorest-beta --java --use:./ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-datetime-rfc1123.json --namespace=fixtures.bodydatetimerfc1123 --output-folder=tests --sync-methods=all
autorest-beta --java --use:./ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-datetime-rfc1123.json --namespace=fixtures.bodydatetimerfc1123 --output-folder=tests --sync-methods=all
3 changes: 2 additions & 1 deletion generate.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ call autorest-beta --java --use:.\ --input-file=https://raw.githubusercontent.co
call autorest-beta --java --use:.\ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-integer.json --namespace=fixtures.bodyinteger --output-folder=tests --sync-methods=all
call autorest-beta --java --use:.\ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-number.json --namespace=fixtures.bodynumber --output-folder=tests --sync-methods=all
call autorest-beta --java --use:.\ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/httpInfrastructure.json --namespace=fixtures.httpinfrastructure --output-folder=tests --sync-methods=all
call autorest-beta --java --use:.\ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/paging.json --namespace=fixtures.paging --output-folder=tests --sync-methods=all
call autorest-beta --java --use:.\ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-byte.json --namespace=fixtures.bodybyte --output-folder=tests --sync-methods=all
call autorest-beta --java --use:.\ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-date.json --namespace=fixtures.bodydate --output-folder=tests --sync-methods=all
call autorest-beta --java --use:.\ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-datetime.json --namespace=fixtures.bodydatetime --output-folder=tests --sync-methods=all
call autorest-beta --java --use:.\ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-datetime-rfc1123.json --namespace=fixtures.bodydatetimerfc1123 --output-folder=tests --sync-methods=all
call autorest-beta --java --use:.\ --input-file=https://raw.githubusercontent.com/Azure/autorest.testserver/master/swagger/body-datetime-rfc1123.json --namespace=fixtures.bodydatetimerfc1123 --output-folder=tests --sync-methods=all
Loading