зеркало из https://github.com/Azure/autorest.git
Fix flattened model with nullable (#4324)
This commit is contained in:
Родитель
55efe04ed6
Коммит
dfe3d095b4
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "@autorest/modelerfour",
|
||||
"comment": "**Internal",
|
||||
"type": "patch"
|
||||
}
|
||||
],
|
||||
"packageName": "@autorest/modelerfour",
|
||||
"email": "tiguerin@microsoft.com"
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
trigger:
|
||||
- main
|
||||
- release/*
|
||||
|
||||
pool:
|
||||
vmImage: "ubuntu-latest"
|
||||
|
|
|
@ -1,6 +1,21 @@
|
|||
{
|
||||
"name": "@autorest/modelerfour",
|
||||
"entries": [
|
||||
{
|
||||
"version": "4.21.4",
|
||||
"tag": "@autorest/modelerfour_v4.21.4",
|
||||
"date": "Mon, 04 Oct 2021 18:15:27 GMT",
|
||||
"comments": {
|
||||
"patch": [
|
||||
{
|
||||
"comment": "**Fix** Flatten nullable property doesn't propagate."
|
||||
},
|
||||
{
|
||||
"comment": "**Internal** remove use of string and array extension method `.last`."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "4.21.3",
|
||||
"tag": "@autorest/modelerfour_v4.21.3",
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
# Change Log - @autorest/modelerfour
|
||||
|
||||
This log was last generated on Wed, 29 Sep 2021 15:39:07 GMT and should not be manually modified.
|
||||
This log was last generated on Fri, 15 Oct 2021 15:41:45 GMT and should not be manually modified.
|
||||
|
||||
## 4.21.4
|
||||
Mon, 04 Oct 2021 18:15:27 GMT
|
||||
|
||||
### Patches
|
||||
|
||||
- **Fix** Flatten nullable property doesn't propagate.
|
||||
- **Internal** remove use of string and array extension method `.last`.
|
||||
|
||||
## 4.21.3
|
||||
Wed, 29 Sep 2021 15:39:07 GMT
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@autorest/modelerfour",
|
||||
"version": "4.21.3",
|
||||
"version": "4.21.4",
|
||||
"description": "AutoRest Modeler Version Four (component)",
|
||||
"directories": {
|
||||
"doc": "docs"
|
||||
|
|
|
@ -29,8 +29,8 @@ export class Checker {
|
|||
const duplicates = findDuplicates(group.operations, (x) => x.language.default.name);
|
||||
for (const [dupe, operations] of Object.entries(duplicates)) {
|
||||
const paths = operations
|
||||
.map((x) => x.requests?.[0].protocol.http?.path)
|
||||
.map((x) => ` - ${x}`)
|
||||
.map((x) => x.requests?.[0].protocol.http)
|
||||
.map((x) => ` - ${x?.method} ${x?.path}`)
|
||||
.join("\n");
|
||||
this.session.error(
|
||||
`Duplicate Operation '${group.language.default.name}' > '${dupe}' detected(This is most likely due to 2 operation using the same 'operationId' or 'tags'). Duplicates have those paths:\n${paths}`,
|
||||
|
|
|
@ -146,12 +146,13 @@ export class Flattener {
|
|||
childProperty.language.default.description,
|
||||
childProperty.schema,
|
||||
{
|
||||
...(<any>childProperty),
|
||||
...childProperty,
|
||||
flattenedNames: [
|
||||
property.serializedName,
|
||||
...(childProperty.flattenedNames ? childProperty.flattenedNames : [childProperty.serializedName]),
|
||||
],
|
||||
required: property.required && childProperty.required,
|
||||
nullable: property.nullable ?? childProperty.nullable,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче