Skip to content

OData v4 functions + actions fail to convert #46

@vobu

Description

@vobu

debug run showed the code from

if (item.isBound) {
to be the culprit:

const service = await parse(v4metadata) // containing a v4 function
// service.functions[x].isBound is of type String, "true"/"false"
// so above linked code in convert() fails in `bindingParameterFromParameters`
// and no functions are included in the swagger spec
const swagger = await convert(
    service.entitySets,
    {
        functions: service.functions
    },
    service.version
)

if manually converted to the proper Boolean, convert(...) runs w/o an issue:

const service = await parse(v4metadata) // containing a v4 function
service.functions = service.functions.map(singleService => {
    let _service = singleService
    _service.isBound = singleService.isBound === "true" ? true : false
    _service.isComposable = singleService.isComposable === "true" ? true : false
    return _service
})
const swagger = await convert(
    service.entitySets,
    {
        functions: service.functions
    },
    service.version
)

env:

  • node v12.16.1
  • odata2openapi 1.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions