NJsonSchema: Missing schema properties in models from interfaces
When a controller specifies its return type as an interface, NSwag generates an empty model for it. The following is an interface, IFixtureData:
public interface IFixtureData
{
ushort Address { get; set; }
FixtureDefinitionSkeleton Type { get; set; }
FixtureOptions Options { get; set; }
string Group { get; set; }
}
In the swagger.json file, the following is generated:
"IFixtureDefinition": {
"type": "object",
"x-abstract": true,
"additionalProperties": false
}
All of my concrete classes are generated properly, but the interfaces are all like this.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 32 (31 by maintainers)
Commits related to this issue
- Test and potential Fix for Interfaces. (#909) (#921) — committed to RicoSuter/NJsonSchema by mjeanrichard 5 years ago
- Release v9.13.25 (#930) * Add test #929 * Fix property type resolution for any schemas in definitions, https://github.com/RSuter/NSwag/issues/2028 * Test and potential Fix for Interfaces. (#909... — committed to RicoSuter/NJsonSchema by RicoSuter 5 years ago
- Add JsonSchemaGeneratorSettings setting, closes #909 — committed to RicoSuter/NJsonSchema by RicoSuter 5 years ago
- Add Interface to JsonSchemaAbstractAttribute, #909 — committed to RicoSuter/NJsonSchema by RicoSuter 5 years ago
Just added it.
Yes, should be available
That’s bad, we need to add that