Summary
Problem: When TypeSpec models have templates (e.g. Ok<T> or Paginated<T>) they don't get emitted as JSON schemas by TypeSpec. This makes it hard to document changes to those fields, like #959, in our schema changelog and generate the correct documentation for them.
Recommendation: The CommonBenefits core library demonstrates how to solve this problem using a combination of base, templated, and non-templated schemas to solve this problem by:
Examples
Acceptance criteria
Summary
Problem: When TypeSpec models have templates (e.g.
Ok<T>orPaginated<T>) they don't get emitted as JSON schemas by TypeSpec. This makes it hard to document changes to those fields, like #959, in our schema changelog and generate the correct documentation for them.Recommendation: The CommonBenefits core library demonstrates how to solve this problem using a combination of base, templated, and non-templated schemas to solve this problem by:
Responses.PaginatedT<Models.ProgramBase>Examples
Acceptance criteria
Ok,Paginated,Filtered, etc.) now have JSON schemas generated for themT(e.g.OkT) and are still used to generate response bodies for the routestsconfig.json-- though I don't think they do at the moment)