Project

Profile

Help

Story #5574

closed

Provide an easy to use way to ensure the ref_name attribute convention

Added by gmbnomis over 4 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Due to issue #5562, pulpcore_plugin proposes a convention for the ref_name attribute of serializer Meta classes.

The current convention needs to be changed, as there is a (vague) recommendation to use a dot for namespaces (see for example https://github.com/OAI/OpenAPI-Specification/issues/1362). This is supported in some tools, but neither in swagger codegen, see https://github.com/swagger-api/swagger-codegen/issues/7326 nor in OpenAPITools/openapi-generator. openapi-generator handles the dot like other special characters (and just removes it from the class name, capitalizing the next word).

Thus, use <app_name>.<model class name> for ref_name. Ref names ("definitions" in the JSON API file) look like "file.FileRemote" then.

The generator creates model classes like "FileFileRemote". For models defined by core, we do not introduce a separate namespace (core.) but leave them as they are today.

For Modelserializers derived from pulpcore's ModelSerializer we can provide a proper default for ref_name.

Also available in: Atom PDF