Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymous models inline support #2072

Merged
merged 36 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
823afa1
Update the changes
MaryGao Oct 19, 2023
9872e68
Support anomymous model simple cases in modular and rlc
MaryGao Oct 19, 2023
1385597
Update the anomymousModel.spec
MaryGao Oct 19, 2023
ee3b9b7
Update the test cases
MaryGao Oct 19, 2023
0a936af
Update the ut for anomymousModel
MaryGao Oct 19, 2023
7560a71
Merge remote-tracking branch 'origin/main' into anonymous-models-inli…
MaryGao Oct 20, 2023
b52fb14
Revert changes in rlc-common
MaryGao Oct 20, 2023
7ab0005
Refactor the RLC code
MaryGao Oct 20, 2023
4ce74d2
Upgrade the eslint version
MaryGao Oct 20, 2023
6b4bad8
Update the test cases
MaryGao Oct 20, 2023
66815cb
Update log
MaryGao Oct 20, 2023
c06f264
Merge remote-tracking branch 'origin/main' into anonymous-models-inli…
MaryGao Oct 23, 2023
1822dd1
Update the record ut
MaryGao Oct 23, 2023
85a2e24
Refresh the eventgrid lib
MaryGao Oct 23, 2023
c3ffe67
Revert changes
MaryGao Oct 23, 2023
0a57fea
Revert changes
MaryGao Oct 23, 2023
39cea9d
Update the new line
MaryGao Oct 23, 2023
f56efac
Update the modular test cases
MaryGao Oct 23, 2023
147e10a
Update the file name
MaryGao Oct 23, 2023
178510d
Merge branch 'main' into anonymous-models-inline-support
MaryGao Oct 24, 2023
a52881b
Resolve conflicts
MaryGao Oct 24, 2023
fdf267c
Remove the empty model validation logic
MaryGao Oct 24, 2023
cdb1f0f
Add UT to cover nullable constants
MaryGao Oct 24, 2023
bb7f761
Update the UT for anonymousModel.spec
MaryGao Oct 24, 2023
330c4dc
Regenerate OpenAI
MaryGao Oct 24, 2023
c2e62cb
Update the cases
MaryGao Oct 24, 2023
fcc8dbb
Update the UTs in RLC
MaryGao Oct 25, 2023
203b1cc
Update the named empty model
MaryGao Oct 25, 2023
cb0507a
Refresh the event grid
MaryGao Oct 25, 2023
5e720cb
Resolve changes
MaryGao Oct 25, 2023
8c25ecd
Update the UT for getModelInlineSigniture
MaryGao Oct 25, 2023
e4ccdca
Update the comments
MaryGao Oct 25, 2023
458f293
Update the comments
MaryGao Oct 25, 2023
5406746
Upgrade the test cases
MaryGao Oct 25, 2023
abec42a
Added the UTs for sample gen
MaryGao Oct 25, 2023
401e7d0
Update the non-empty anonymous model cases
MaryGao Oct 25, 2023
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
154 changes: 73 additions & 81 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/autorest.typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
"@types/sinon": "^10.0.0",
"@types/xmlbuilder": "0.0.34",
"@types/yargs": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"autorest": "^3.4.2",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/rlc-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"chai": "^4.3.7",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"eslint-plugin-require-extensions": "0.1.3",
"cross-env": "7.0.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/rlc-common/src/buildObjectTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,4 +484,4 @@ function generateForOutput(
(schemaUsage.includes(SchemaContext.Exception) &&
propertyUsage?.includes(SchemaContext.Exception))
);
}
}
4 changes: 4 additions & 0 deletions packages/rlc-common/src/helpers/valueGenerationUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function mockUnionValues(
) {
const schema = schemaMap.get(type);
if (schema && schema.enum && schema.enum.length > 0) {
addToSchemaMap(schemaMap, schema.enum[0]);
return generateParameterTypeValue(
getAccurateTypeName(schema.enum[0]) ?? schema.enum[0],
parameterName,
Expand Down Expand Up @@ -242,6 +243,9 @@ function getAccurateTypeName(schema: Schema) {

function addToSchemaMap(schemaMap: Map<string, Schema>, schema: Schema) {
const type = getAccurateTypeName(schema);
if (!type) {
return;
}
if (
!schemaMap.has(type) &&
!["string", "number", "boolean"].includes(schema.type)
Expand Down
Loading
Loading