How to use the grlc.pagination function in grlc

To help you get started, we’ve selected a few grlc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CLARIAH / grlc / src / swagger.py View on Github external
pagination = query_metadata['pagination'] if 'pagination' in query_metadata else ""

    endpoint_in_url = query_metadata['endpoint_in_url'] if 'endpoint_in_url' in query_metadata else True

    projection = loader.getProjectionForQueryName(call_name)

    # Processing of the parameters
    params = []

    # PV properties
    item_properties = {}

    # If this query allows pagination, add page number as parameter
    if pagination:
        params.append(pageUtils.getSwaggerPaginationDef(pagination))

    if query_metadata['type'] in ['SelectQuery', 'ConstructQuery', 'InsertData']:
        # TODO: do something intelligent with the parameters!
        # As per #3, prefetching IRIs via SPARQL and filling enum
        parameters = query_metadata['parameters']

        for v, p in list(parameters.items()):
            param = {}
            param['name'] = p['name']
            param['type'] = p['type']
            param['required'] = p['required']
            param['in'] = "query"
            param['description'] = "A value of type {} that will substitute {} in the original query".format(p['type'],
                                                                                                             p[
                                                                                                                 'original'])
            if 'lang' in p: