Giter VIP home page Giter VIP logo

Comments (5)

Shwetap05 avatar Shwetap05 commented on June 4, 2024

@jdusome Do you want these annotations <x-ms-notification-url> to show up as https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#specificationExtensions ? If so you can achieve that my writing a custom filter class that derives from https://github.com/microsoft/OpenAPI.NET.CSharpAnnotations/blob/master/src/Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration/OperationFilters/IOperationFilter.cs and update filter to parse these tags and update the document.

And passing it to the library for an example take a look at test case GetTestCasesForPassANewFilterAndShouldReturnCorrectDocument in https://github.com/microsoft/OpenAPI.NET.CSharpAnnotations/blob/master/test/Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration.Tests/OpenApiDocumentGeneratorTests/OpenApiDocumentGeneratorTest.cs

let me know if you have any specific question around custom filter,

from openapi.net.csharpannotations.

jdusome avatar jdusome commented on June 4, 2024

I think that is precisely what I am looking for, I will give that a shot and get back to you if I have any questions regarding the custom filter. Thank you.

from openapi.net.csharpannotations.

jdusome avatar jdusome commented on June 4, 2024

@Shwetap05 I was able to successfully use an Operation Filter to get some of the custom Microsoft extensions into the Open API document. Thank you very much for your response. Is it possible to do something similar for the Schemas that are generated? In my original post, I am referring to the object that is returned from an operation. The library is currently able to import the summary, although it would be really nice if I could also import additional elements as well.

from openapi.net.csharpannotations.

Shwetap05 avatar Shwetap05 commented on June 4, 2024

@jdusome can you please provide more details on what additional elements you want included in schema?

from openapi.net.csharpannotations.

jdusome avatar jdusome commented on June 4, 2024

@Shwetap05 Certainly! In the original screenshot, you can see that I created the XML style comments on my PortalUserRegistrationSubscribeRequest object. It generates the second screenshot in the Open API definition, though I would like to generate the following:

image

(Notice the custom x-ms attributes on the callBackUrl property)

I was able to accomplish this for the operations using an Operation Filter as you suggested, but I would like to accomplish something similar for the Schemas that being generated.

from openapi.net.csharpannotations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.