···200200 const schemaProperties: Record<string, IR.SchemaObject> = {};
201201202202 for (const name in schema.properties) {
203203- const property = schema.properties[name];
203203+ const property = schema.properties[name]!;
204204 if (typeof property === 'boolean') {
205205 // TODO: parser - handle boolean properties
206206 } else {
···395395396396 // TODO: parser - this is a hack to bring back up meta fields
397397 // without it, some schemas were missing original deprecated
398398- if (nestedItems[0].deprecated) {
399399- irSchema.deprecated = nestedItems[0].deprecated;
398398+ if (nestedItems[0]!.deprecated) {
399399+ irSchema.deprecated = nestedItems[0]!.deprecated;
400400 }
401401402402 // TODO: parser - this is a hack to bring back up meta fields
403403 // without it, some schemas were missing original description
404404- if (nestedItems[0].description) {
405405- irSchema.description = nestedItems[0].description;
404404+ if (nestedItems[0]!.description) {
405405+ irSchema.description = nestedItems[0]!.description;
406406 }
407407 }
408408
···314314 // let hasOptionalProperties = false;
315315316316 for (const name in schema.properties) {
317317- const property = schema.properties[name];
317317+ const property = schema.properties[name]!;
318318 const isRequired = required.includes(name);
319319320320 let propertyExpression = schemaToZodSchema({
···779779 );
780780781781 if (schema.logicalOperator === 'and') {
782782- const firstSchema = schema.items[0];
782782+ const firstSchema = schema.items[0]!;
783783 // we want to add an intersection, but not every schema can use the same API.
784784 // if the first item contains another array or not an object, we cannot use
785785 // `.merge()` as that does not exist on `.union()` and non-object schemas.
···1111 */
1212export const refToName = ($ref: string): string => {
1313 const parts = refToParts($ref);
1414- const name = parts[parts.length - 1];
1414+ const name = parts[parts.length - 1]!;
1515 // refs using unicode characters become encoded, didn't investigate why
1616 // but the suspicion is this comes from `@apidevtools/json-schema-ref-parser`
1717 return decodeURI(name);
+1-1
packages/openapi-ts/src/utils/stringCase.ts
···3131 _case === 'snake_case' || _case === 'SCREAMING_SNAKE_CASE' ? '_' : '-';
32323333 for (let index = 0; index < string.length; index++) {
3434- const character = string[index];
3434+ const character = string[index]!;
3535 isLastLastCharPreserved =
3636 index > 2 ? string[index - 3] === separator : true;
3737
+1-1
packages/openapi-ts/src/utils/type.ts
···4141 * {@link https://github.com/hey-api/openapi-ts/issues/768}
4242 */
4343 if (model.export === 'reference' && model.$refs.length === 1) {
4444- if (model.$refs[0].startsWith(refSchemasPartial)) {
4444+ if (model.$refs[0]!.startsWith(refSchemasPartial)) {
4545 const meta = getSchemasMeta(model.base);
4646 typeNode = compiler.typeNode(meta.name);
4747 }