Closed luizfbicalho closed 9 months ago
I will check on weekend - thanks for spotting this
@AdaskoTheBeAsT Is there anything I can help you with?
In the original project I added some issues that never worked, would like to help with this
@luizfbicalho you can test it https://github.com/AdaskoTheBeAsT/Typewriter/releases/tag/v2.12.0
It worked kind of fine on one place, But I got a lot of errors in other places,
for example in some places I need the string | null , but some times I need only the string, is there a new property that I can rely on?
I have a lot of code in tst tat I would like to make an extension or something like just a include , do you have any plans on that?
I think that the method.Url() changed, from this
api/ControllerBase/?actionName=${encodeURIComponent(actionName)}
to this
api/ControllerBase/?actionName=${actionName}
I will check uri generated - for other things i will need sample class - rule is simple - whenever in c# somwthing is of type string? - it generates string | null in TypeScript
Thanks
I just found this problem in Url, the others I had to create a function to replace the " | null" in the type.Name I think that you could create a property StrictName or other name, that didn't have the | null
One thing in parallel, what should be the process to add one dll with extensions to the typewriter, like the WebApi Extension?
ok I fixed regression with encodeUriComponent for security reason I do not accept dll's only code in pull requests
I can provide only flag for global either adding | null for all types or not custom treating every class can be realised by devs by using custom attributes as I have shown in case of enums
Thanks, I'll try the encode
I think that I can't explain my problem and I'm creating a confusion, so I'll create new issues if it's the case
Instead of this code, what do you suggest
var propName = prop.Type.Name.Replace("[]","").Replace(" | null","");
if( propName != "string"
&& propName != "number"
&& propName != "Date"
&& propName != "boolean"
&& propName != "any"
&& propName != "void"
&& !prop.Type.IsEnum)
{
If a property is not nullable, does the Property.Type.Default() should never return null right?
I had to change this code in my template
ts public $Name: $Type $IsNullableType = $ReferenceDefaultValue;
This is a reference to PR #1
should this be inside the type ?