RDFLib / pyLDAPI

A very small module to add Linked Data API functionality to a Python Flask installation
BSD 3-Clause "New" or "Revised" License
41 stars 11 forks source link

Redundant uri parameter in RegisterRenderer __init__() #7

Closed edmondchuc closed 4 years ago

edmondchuc commented 5 years ago

The pyldapi.RegisterRenderer() already contains a parameter for a Flask request object, which can get the uri/url. No need for business code to provide it as an additional argument.

r = pyldapi.RegisterRenderer(
        request,
        request.url, # <-- redundant
        'Sample Register',
        'A register of Samples',
        items,
        [conf.URI_SAMPLE_CLASS],
        no_of_items
)
nicholascar commented 4 years ago

RegisterRenderer has been replaced with ContainerRenderer which now has a property instance_uri.

This property is not redundant as the Container URI might need to be expressed with a persistent URI rather than the API endpoint URI if a PID URI is used to redirect to that Container.