RicoSuter/NSwag

[nswag, v12.0.0] SwaggerToTypeScriptClientGenerator ignores the "readOnly" flag for properties

Open

#1,763 建立於 2018年11月22日

在 GitHub 查看
 (14 留言) (0 反應) (0 負責人)C# (6,291 star) (1,189 fork)batch import
help wantedproject: NJsonSchema.CodeGeneration.TypeScripttype: question

描述

The TypeScript code generated by nswag does not add the readonly TypeScript modifier for properties that has readOnly set to true in the Swagger specification file.

According to the Class.liquid template the modifier is added if property.IsReadOnly is true. I tried to debug using a custom template and property.IsReadOnly is set to false even for read-only properties.

I have observed this behavior for quite some time now and initially thought this could be by design. However, it seems to me that this is actually a bug.

貢獻者指南