chore(dotnet): do not rely on auto camel case for channel initializers (#13867)

This commit is contained in:
Max Schmitt 2022-05-02 15:29:35 +01:00 committed by GitHub
parent 1ffd18f131
commit 2dafbfc2dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -114,6 +114,7 @@ function properties(properties, indent, onlyOptional) {
if (onlyOptional && !inner.optional)
continue;
ts.push('');
ts.push(`${indent}[JsonPropertyName("${name}")]`)
ts.push(`${indent}public ${inner.ts}${nullableSuffix(inner)} ${toTitleCase(name)} { get; set; }`);
const wrapped = inner.optional ? `tOptional(${inner.scheme})` : inner.scheme;
scheme.push(`${indent}${name}: ${wrapped},`);
@ -183,6 +184,7 @@ for (const [name, item] of Object.entries(protocol)) {
*/
`)
channels_ts.push('using System.Collections.Generic;');
channels_ts.push('using System.Text.Json.Serialization;')
channels_ts.push(``);
channels_ts.push(`namespace Microsoft.Playwright.Transport.Protocol`);
channels_ts.push(`{`);