Use “subdirectory” in base-url does not work with version 0.7.1 (was working with 0.6.0)
I have an instance, served on a subdirectory (https://superapp.logilab.fr/sub for instance), and the startup of this instance fails because the folling routes are not found: /current-user, /rql, /schema, /transaction/begin, /transaction/commit, /transaction/execute, /transaction/rollback
instance XXX not started: Unable to find routes for endpoints: /current-user, /rql, /schema, /transaction/begin, /transaction/commit, /transaction/execute, /transaction/rollback
the generated ~/etc/cubicweb.d/XXX/openapi.yaml
is the following:
components:
schemas:
CWSchema:
properties:
entities:
items:
properties:
description:
type: string
final:
type: boolean
type:
type: string
type: object
type: array
relations_definitions:
items:
properties:
cardinality:
type: string
constraints:
nullable: true
type: array
default:
nullable: true
type: string
description:
type: string
final:
type: boolean
object:
type: string
subject:
type: string
type:
type: string
type: object
type: array
type: object
CurrentUser:
nullable: true
properties:
dcTitle:
type: string
eid:
type: integer
login:
type: string
required:
- eid
- login
- dcTitle
type: object
ErrorSchema:
properties:
code:
type: integer
error:
properties:
data:
type: object
message:
type: string
title:
type: string
required:
- message
- title
type: object
title:
type: string
required:
- code
- title
- error
type: object
LoginParams:
properties:
login:
minLength: 1
type: string
password:
minLength: 1
type: string
required:
- login
- password
type: object
RqlParams:
properties:
params:
additionalProperties:
nullable: true
default: {}
type: object
query:
minLength: 1
type: string
required:
- query
type: object
TransactionExecuteParams:
properties:
params:
additionalProperties:
nullable: true
default: {}
type: object
query:
minLength: 1
type: string
uuid:
minLength: 32
type: string
required:
- query
- uuid
type: object
TransactionParams:
properties:
uuid:
minLength: 32
type: string
required:
- uuid
type: object
info:
contact:
email: contact@logilab.fr
name: LOGILAB S.A. (Paris, FRANCE)
url: https://forge.extranet.logilab.fr/cubicweb/cubes/api
description: This cube is the new api which will be integrated in CubicWeb 4.
license:
name: LGPL
url: https://www.gnu.org/licenses/lgpl-3.0.en.html
title: CubicWeb API
version: 0.1.0
openapi: 3.0.3
paths:
/current-user:
get:
description: Get information about the user making the request
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CurrentUser'
description: This instance's Schema
x-pyramid-route-name: cube_api_v1_current_user
/login:
post:
description: Tries to log in the user
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/LoginParams'
responses:
'204':
description: Token has been created and returned in set-cookie header
headers:
Set-Cookie:
description: The created JWT
schema:
type: string
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorSchema'
description: THe given login/password combo was not recognized
x-pyramid-route-name: cube_api_v1_login
/rql:
post:
description: Executes the given RQL query
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RqlParams'
responses:
'200':
content:
application/json:
schema:
items:
items:
oneOf:
- nullable: true
type: string
- type: number
- type: boolean
type: array
type: array
description: The RQL result set
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorSchema'
description: The given RQL was badly formatted
x-pyramid-route-name: cube_api_v1_rql
/schema:
get:
description: Returns this instance's Schema
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CWSchema'
description: This instance's Schema
x-pyramid-route-name: cube_api_v1_schema
/transaction/begin:
post:
description: Starts a new transaction
responses:
'200':
content:
application/json:
schema:
type: string
description: The transaction's uuid
x-pyramid-route-name: cube_api_v1_transaction/begin
/transaction/commit:
post:
description: Commits a transaction
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionParams'
responses:
'200':
description: The transaction was successful
x-pyramid-route-name: cube_api_v1_transaction/commit
/transaction/execute:
post:
description: Executes the given rql query as part of a transaction
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionExecuteParams'
responses:
'200':
content:
application/json:
schema:
items:
type: object
type: array
description: The RQL result set
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorSchema'
description: The given RQL was badly formatted
x-pyramid-route-name: cube_api_v1_transaction/execute
/transaction/rollback:
post:
description: Rollback a transaction
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionParams'
responses:
'200':
description: The transaction rollback was successful
x-pyramid-route-name: cube_api_v1_transaction/rollback
servers:
- url: https://superapp.logilab.fr/sub/api/v1
the options in the all-in-one.conf are :
$ grep -i api ~/etc/cubicweb.d/XXX/all-in-one.conf
[API]
# prefix used for the url path. The api version number will be added after this
api-path-prefix=/api