Browse Source

fix: use camel where property names are collected

pull/5706/head
Arman Ozak 6 years ago
parent
commit
8b7d062432
  1. 4
      npm/ng-packs/packages/schematics/src/models/method.ts
  2. 4
      npm/ng-packs/packages/schematics/src/utils/model.ts

4
npm/ng-packs/packages/schematics/src/models/method.ts

@ -1,5 +1,5 @@
import { strings } from '@angular-devkit/core';
import { eBindingSourceId, eMethodModifier } from '../enums';
import { camel } from '../utils';
import { ParameterInBody } from './api-definition';
import { Property } from './model';
import { Omissible } from './util';
@ -42,7 +42,7 @@ export class Body {
registerActionParameter = (param: ParameterInBody) => {
const { bindingSourceId, descriptorName, name, nameOnMethod } = param;
const camelName = strings.camelize(name);
const camelName = camel(name);
const value = descriptorName ? `${descriptorName}.${camelName}` : nameOnMethod;
switch (bindingSourceId) {

4
npm/ng-packs/packages/schematics/src/utils/model.ts

@ -1,8 +1,8 @@
import { strings } from '@angular-devkit/core';
import { VOLO_NAME_VALUE, VOLO_REGEX } from '../constants';
import { Interface, Model, Property, Type, TypeWithEnum } from '../models';
import { parseNamespace } from './namespace';
import { relativePathToModel } from './path';
import { camel } from './text';
import { parseGenerics } from './tree';
import {
createTypeParser,
@ -118,7 +118,7 @@ export function createImportRefToInterfaceReducerCreator(params: ModelGeneratorP
const _interface = new Interface({ identifier, base, namespace, ref });
typeDef.properties?.forEach(prop => {
const name = strings.camelize(prop.name);
const name = camel(prop.name);
const optional = prop.typeSimple.endsWith('?') ? '?' : '';
const type = simplifyType(prop.typeSimple);
const refs = parseType(prop.type).reduce(

Loading…
Cancel
Save