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

Bump core from 79f8870 to b47d039 #1791

Merged
merged 5 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
@@ -0,0 +1,8 @@
---
changeKind: fix
packages:
- "@azure-tools/typespec-autorest"
- "@azure-tools/typespec-client-generator-core"
---

Report error when trying to use cookies
2 changes: 1 addition & 1 deletion core
Submodule core updated 77 files
+9 −0 .chronus/changes/cookie-decorator-2024-9-22-1-33-4.md
+7 −0 .chronus/changes/fix-open-api-empty-schema-2024-10-1-6-50-22.md
+1 −1 .github/workflows/website-gh-pages.yml
+5 −0 packages/astro-utils/README.md
+38 −0 packages/astro-utils/package.json
+1 −1 packages/astro-utils/src/components/link.astro
+1 −1 packages/astro-utils/src/components/theme-picker.astro
+0 −0 packages/astro-utils/src/css/dark.css
+0 −0 packages/astro-utils/src/css/fluentui.css
+0 −0 packages/astro-utils/src/css/light.css
+2 −0 packages/astro-utils/src/env.d.ts
+49 −0 packages/astro-utils/src/expressive-code/config.ts
+91 −0 packages/astro-utils/src/expressive-code/plugins/tsp-tryit-code.ts
+0 −0 packages/astro-utils/src/index.ts
+13 −0 packages/astro-utils/src/shiki/index.ts
+14 −9 packages/astro-utils/src/sidebar/index.ts
+0 −0 packages/astro-utils/src/utils/base-url.ts
+8 −0 packages/astro-utils/src/utils/link.ts
+1 −1 packages/astro-utils/src/utils/theme-react.ts
+0 −0 packages/astro-utils/src/utils/theme.ts
+11 −0 packages/astro-utils/tsconfig.build.json
+6 −0 packages/astro-utils/tsconfig.json
+23 −4 ...ent-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs
+29 −26 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputModelType.cs
+4 −0 .../generator/Microsoft.Generator.CSharp.Input/src/InputTypes/Serialization/TypeSpecInputModelTypeConverter.cs
+13 −3 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Providers/ModelProvider.cs
+1 −1 ...ient-csharp/generator/Microsoft.Generator.CSharp/test/Providers/ModelFactories/ModelFactoryProviderTests.cs
+76 −2 ...http-client-csharp/generator/Microsoft.Generator.CSharp/test/Providers/ModelProviders/DiscriminatorTests.cs
+31 −0 ...client-csharp/generator/Microsoft.Generator.CSharp/test/Providers/ModelProviders/ModelCustomizationTests.cs
+24 −0 ...tor.CSharp/test/Providers/ModelProviders/TestData/ModelCustomizationTests/CanCustomizeDiscriminatorModel.cs
+9 −0 ...viders/ModelProviders/TestData/ModelCustomizationTests/CanCustomizeDiscriminatorModel/DiscriminatorValue.cs
+2 −0 packages/http-server-javascript/src/http/server/index.ts
+42 −0 packages/http/README.md
+28 −0 packages/http/generated-defs/TypeSpec.Http.ts
+32 −0 packages/http/lib/decorators.tsp
+44 −0 packages/http/src/decorators.ts
+29 −1 packages/http/src/http-property.ts
+7 −0 packages/http/src/lib.ts
+3 −1 packages/http/src/metadata.ts
+1 −0 packages/http/src/parameters.ts
+11 −8 packages/http/src/payload.ts
+2 −0 packages/http/src/tsp-index.ts
+10 −1 packages/http/src/types.ts
+70 −0 packages/http/test/http-decorators.test.ts
+1 −0 packages/http/test/parameters.test.ts
+18 −0 packages/http/test/responses.test.ts
+5 −1 packages/openapi3/src/cli/actions/convert/generators/generate-model.ts
+4 −0 packages/openapi3/src/openapi.ts
+26 −2 packages/openapi3/test/metadata.test.ts
+35 −2 packages/openapi3/test/parameters.test.ts
+22 −1 packages/openapi3/test/return-types.test.ts
+41 −0 packages/openapi3/test/tsp-openapi3/convert-openapi3-doc.test.ts
+410 −99 pnpm-lock.yaml
+2 −1 tsconfig.ws.json
+9 −15 website/astro.config.mjs
+2 −45 website/ec.config.mjs
+3 −5 website/package.json
+1 −1 website/src/components/button.astro
+1 −1 website/src/components/feature-list.astro
+2 −2 website/src/components/footer/footer.astro
+2 −2 website/src/components/header/header.astro
+0 −15 website/src/components/header/link.astro
+0 −15 website/src/components/layouts/fluent-layout.tsx
+1 −1 website/src/components/learn-more-card.astro
+1 −1 website/src/components/playground-component/playground.tsx
+12 −3 website/src/components/react-pages/playground.tsx
+1 −1 website/src/content/current-sidebar.ts
+16 −0 website/src/content/docs/docs/libraries/http/reference/data-types.md
+41 −0 website/src/content/docs/docs/libraries/http/reference/decorators.md
+2 −0 website/src/content/docs/docs/libraries/http/reference/index.mdx
+2 −0 website/src/content/docs/docs/libraries/http/reference/linter.md
+1 −1 website/src/css/custom.css
+1 −1 website/src/layouts/base-layout.astro
+1 −1 website/src/pages/blog/_BlogPostPreview.astro
+1 −1 website/src/pages/index.astro
+2 −2 website/src/utils/index.ts
+0 −13 website/src/utils/link.ts
6 changes: 6 additions & 0 deletions packages/typespec-autorest/src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ export const $lib = createTypeSpecLibrary({
default: paramMessage`Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part '${"part"}'.`,
},
},
"cookies-unsupported": {
severity: "warning",
messages: {
default: `Cookies are not supported in Swagger 2.0. Parameter was ignored.`,
},
},
"invalid-format": {
severity: "warning",
messages: {
Expand Down
7 changes: 7 additions & 0 deletions packages/typespec-autorest/src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,10 @@ export async function getOpenAPIForService(
if (httpOpParam.type === "header" && isContentTypeHeader(program, httpOpParam.param)) {
continue;
}
if (httpOpParam.type === "cookie") {
reportDiagnostic(program, { code: "cookies-unsupported", target: httpOpParam.param });
continue;
}
emitParameter(httpOpParam.param, () =>
getOpenAPI2Parameter(httpOpParam, { visibility, ignoreMetadataAnnotations: false }),
);
Expand Down Expand Up @@ -1437,6 +1441,9 @@ export async function getOpenAPIForService(
return getOpenAPI2PathParameter(param, schemaContext);
case "header":
return getOpenAPI2HeaderParameter(param.param, schemaContext, param.name);
case "cookie":
compilerAssert(false, "Should verify cookies before");
break;
default:
const _assertNever: never = param;
compilerAssert(false, "Unreachable");
Expand Down
5 changes: 4 additions & 1 deletion packages/typespec-client-generator-core/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,13 @@ function getSdkHttpParameters(
parameters: [],
bodyParam: undefined,
};

retval.parameters = httpOperation.parameters.parameters
.filter((x) => !isNeverOrVoidType(x.param.type))
.map((x) =>
diagnostics.pipe(getSdkHttpParameter(context, x.param, httpOperation.operation, x, x.type)),
diagnostics.pipe(
getSdkHttpParameter(context, x.param, httpOperation.operation, x, x.type as any),
),
)
.filter(
(x): x is SdkHeaderParameter | SdkQueryParameter | SdkPathParameter =>
Expand Down
Loading
Loading