RicoSuter/NSwag
在 GitHub 查看[nswag, v12.0.0] SwaggerToTypeScriptClientGenerator ignores the "readOnly" flag for properties
Open
#1,763 建立於 2018年11月22日
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.