Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bug: Using no relative path prefix produces wrong code dsl.Files #3663

@gabyx

Description

@gabyx

Goa is awesome, but we have seen an issue which occures when doing:

	dsl.Files("/mysuperduperapi.json", "a/b/c/openapi3.json")

The code does produces ([code])(https://github.com/goadesign/examples/blob/master/basic/gen/http/calc/server/server.go#L56)

	fileSystemPkgGenHTTPOpenapi3JSON = appendPrefix(fileSystemPkgGenHTTPOpenapi3JSON, "/a/b/c")

but if the a/b/c/ is dropped, e.g. dsl.Files("/mysuperduperapi.json", "openapi3.json")

Goa does not generate the appendPrefix which does not result in selecting the openapi3.json but trying to access mysuperduperapi.json (instead of openapi.json)
So I think appendPrefix should always be generate even if its with "." to select the openapi3.json.

P.S. Maybe this is also intended behavior, but its kind of odd, because only

  • dsl.Files("/openapi3.json", "openapi3.json") works
  • dsl.Files("/openapi.json", "openapi3.json") does not work

This is triggered by this line basically

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