Skip to content

Custom primary key reference in path (API spec plugin) #18

@mahenzon

Description

@mahenzon

Now id field is hardcoded in API spec

@property
def param_id(self) -> dict:
return {
"in": "path",
"name": "id",
"required": True,
"type": "integer",
"format": "int32",
}

we can allow defining primary key field on the ResourceDetail subclass and check it
(for get here, and other references for param_id:)

if issubclass(resource, ResourceDetail):

get field from schema by name, create spec for it

why:

support such paths as /api/person/<string:public_id>/ where public_id is unique/pk

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions