Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OData v4 functions + actions fail to convert #46

Open
vobu opened this issue Apr 1, 2020 · 0 comments
Open

OData v4 functions + actions fail to convert #46

vobu opened this issue Apr 1, 2020 · 0 comments

Comments

@vobu
Copy link

vobu commented Apr 1, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant