Skip to content

feat(repository-json-schema): add title to filter #4290

@derdeka

Description

@derdeka

Suggestion

Add title property to filter schema definition in order to enable better code generation by third party tools such as https://github.com/OpenAPITools/openapi-generator .

Without a title property the generator simply name the filter as Filter1, Filter2, etc. By adding the title property, the tooling can produce a filter interface named after title.

Use Cases

Parameters of controller methods are decorated with @param.query.object where getFilterSchemaFor(User) generates a JsonSchema for the filter.

@param.query.object('filter', getFilterSchemaFor(User)) filter?: Filter<User>,

When using openapi-generator, this filter gets just named Filter1. With a large number of filters in a project and randomized order of generation, the git history of the generated files gets trashed.

Discussion points

One filter getFilterSchemaFor(ModelX) can be used multiple times in a project. Currently the filters are created inline. Simply adding a title like ModelXFilter creates name collisions when generating the client sdk. Is it helpful to move Filters to /components/schemas ?

Acceptance criteria

TBD - will be filled by the team.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions