Skip to content

Commit

Permalink
fix: format为int64时,type为string, issue #117 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilinhao1054 committed Nov 15, 2023
1 parent a3ef60e commit 78eefa8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/serviceGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ const defaultGetType = (schemaObject: SchemaObject | undefined, namespace: strin
let { type } = schemaObject as any;

const numberEnum = [
'int64',
'integer',
'long',
'float',
Expand All @@ -139,6 +138,7 @@ const defaultGetType = (schemaObject: SchemaObject | undefined, namespace: strin

if (numberEnum.includes(schemaObject.format)) {
type = 'number';
if (schemaObject.format === 'int64') type = 'string';
}

if (schemaObject.enum) {
Expand Down Expand Up @@ -458,8 +458,9 @@ class ServiceGenerator {
);
if (newApi.extensions && newApi.extensions['x-antTech-description']) {
const { extensions } = newApi;
const { apiName, antTechVersion, productCode, antTechApiName } =
extensions['x-antTech-description'];
const { apiName, antTechVersion, productCode, antTechApiName } = extensions[
'x-antTech-description'
];
formattedPath = antTechApiName || formattedPath;
this.mappings.push({
antTechApi: formattedPath,
Expand Down

1 comment on commit 78eefa8

@MicroOps-cn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对于这种更新,是不是应该提供一个可选配置,我这更新后一大堆报错。

Please sign in to comment.