Skip to content

server url and routes autogeneration #194

@mattiaverga

Description

@mattiaverga

I can't found an example that covers my case, so it may be me doing something wrong.

I've put this in pyramid config:

config.include("pyramid_openapi3")
config.pyramid_openapi3_spec_directory(
    os.path.join(os.path.dirname(__file__), 'openapi', 'openapi.yaml'), route='/api/v2/spec')
config.pyramid_openapi3_add_explorer(route='/api/v2')

config.pyramid_openapi3_register_routes()

and in openapi.yaml file I have:

servers:
  - url: /api

paths:
  /v2/users/:
    x-pyramid-route-name: users_api_v2

I get a 404 Page Not Found for /api/v2/users/, while /v2/users/ works (but doesn't validate against the server, obviously).
To make things work I have to set the server as just / and move api to the path. Is that how it is supposed to work, or route autogeneration doesn't work right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions