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

Missing cli feature: Add $metadata operation and root #285

Open
gregorwolf opened this issue Feb 15, 2024 · 4 comments
Open

Missing cli feature: Add $metadata operation and root #285

gregorwolf opened this issue Feb 15, 2024 · 4 comments
Labels

Comments

@gregorwolf
Copy link

Hi @ralfhandl,

the Web Interface at https://convert.odata-openapi.net/ by @WillEastbury and contributions from @MartinPankraz has an option "Add $metadata operation and root" in the "Optional Parameters". Would be great if this could be added to the odata-openapi3 cli.

Best Regards
Gregor

@ralfhandl
Copy link
Contributor

Hi @gregorwolf,

I was wondering what the /$metadata path would state and checked the OData Transformer you linked above. Result is

    "/$metadata": {
      "get": {
        "summary": "$Metadata endpoint",
        "operationId": "$metadata/get",
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    }

Now I wonder how this would be helpful. Could you please provide a use case?

Thanks in advance

@gregorwolf
Copy link
Author

In my current scenario there is an API management system that only allows requests that match the OpenAPI specification.

@ralfhandl
Copy link
Contributor

ralfhandl commented Feb 16, 2024

What requirements does your API management system have regarding preciseness of the request description? The example above basically allows any kind of response.

Would it be an option for you to reflect the specialties of your API management system in a post-processing step that adds a system-specific /$metadata path?

@WillEastbury
Copy link

Hey Ralf, that's pretty much what the converter site described above does, it's not overly complex to do to be honest.
Here's the few lines of code we use to add it.

https://github.com/WillEastbury/odata-openapi/blob/f5468e21135e12af97427d70a06664a746afa689/fnappdotnet/OpenAPIConverterAndPatches.cs#L183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants