Merged
Conversation
|
weeping seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
yndu13
reviewed
Jan 7, 2026
| this.headers.push(`${this.modelHeader}/${canonicalName}.hpp`); | ||
|
|
||
| // 完全保持原始大小写,不做任何规范化 | ||
| const canonicalKey = modelName.toLowerCase(); |
Contributor
There was a problem hiding this comment.
canonicalKey是不是应该使用原始modelName,你toLowerCase后,就会报OIDC和oidc同名
Collaborator
Author
There was a problem hiding this comment.
这块是因为,mac不区分大小写,没法生成不区分大小写同名的文件,所以加了一个规则:8. Model同名时,生成在一个文件中,但是生成两个class,文件名以先读取到的model name为准,例如下面这两个model,需要生成TestModelDir.hpp,而不生成TestModelDIR.hpp,然后其它文件include的时候,只需要引用TestModelDir.hpp,而不要引用未生产的TestModelDIR.hpp
model TestModelDir {
test: number,
m: User.Info
}
model TestModelDIR {
test: string,
a: any,
}
yndu13
reviewed
Jan 7, 2026
| #include <darabonba/models/MoMValues.hpp> | ||
| #include <darabonba/models/MyModel.hpp> | ||
| #include <darabonba/models/Model.hpp> | ||
| #include <darabonba/models/model.hpp> |
Collaborator
Author
There was a problem hiding this comment.
原始model name就是小写的,新的文件我不区分大小写推送了。
yndu13
reviewed
Jan 7, 2026
lib/generator.js
Outdated
| // 所有 getter 方法都使用 get 前缀 | ||
| const getterName = _getGetterName(name); | ||
| // 对于 params 变量,直接使用字段名;其他情况使用 get 前缀 | ||
| const getterName = (expr === 'params') ? name : _getGetterName(name); |
Collaborator
Author
45455fb to
e378063
Compare
feat(generator): optimize getter access for system built-in types - Add isSystemBuiltinType method to identify Darabonba system built-in types - Remove get prefix for REQUEST, RUNTIME and system built-in type property access, use direct member method calls instead - Use bracket access for property names with special characters to avoid compilation issues - Optimize access pattern for request.query and request.headers properties using map bracket assignment - Refactor getter call logic in generated code to improve readability and correctness - Add command-line argument parsing and output directory generation script to generate.js - Fix header file inclusion order to ensure Encoder header is properly included - Update Client.cpp test fixtures to use new getter call convention
yndu13
reviewed
Jan 8, 2026
lib/generator.js
Outdated
| // 所有 getter 方法都使用 get 前缀 | ||
| const getterName = _getGetterName(name); | ||
| // 对于 params 变量,直接使用字段名;其他情况使用 get 前缀 | ||
| const getterName = (expr === 'params') ? name : _getGetterName(name); |
| DaraLogger::log(err.getName()); | ||
| } catch (const Darabonba::Exception err) { | ||
| DaraLogger::log(err.getName()); | ||
| DaraLogger::log(err.name()); |
yndu13
reviewed
Jan 8, 2026
lib/generator.js
Outdated
| // 对于 response_->的特殊字符属性,直接使用下标访问(不调用方法) | ||
| expr += `["${name}"]`; | ||
| } else { | ||
| expr += `->${name}()`; |
… calls - Change runtime_.retryOptions() to runtime_.getRetryOptions() - Change _context.exception() to _context.getException() - Rename response_ class methods to add a get prefix (e.g., getStatusCode()) - Add get prefix to request accessors (e.g., getQuery(), getHeaders()) - Adjust model access handling for special naming and shared_ptr response types - Remove the no-longer-used system builtin type check isSystemBuiltinType - Make model empty() return true when the model has no fields - Standardize all field getters to use the get prefix to avoid naming conflicts
e378063 to
23c239c
Compare
yndu13
approved these changes
Jan 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.