Comments (5)
@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.
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.
@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.
@jdusome can you please provide more details on what additional elements you want included in schema?
from openapi.net.csharpannotations.
@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:
(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)
- Specifying format on properties? HOT 2
- Definition and Assignment of OAuth Scopes HOT 1
- Can't reference nested class or enum in an annotation HOT 1
- IgnoreDataMember attribute is not honored
- Cannot parse complex url parameter HOT 3
- Cannot parse x-functions-key parameter HOT 2
- System.UInt32 incorrectly translated to OpenApi format "int32" HOT 1
- Issues with .NET Standard 2.1 support
- Add the ability to generate variant documents without also generating the master document
- Allow setting "Deprecated" flag on operations through comment tag
- C# byte type incorrectly translated to OpenAPI type:string/format:byte
- Unable to specify custom IPropertyNameResolver in SchemaGenerationSettings HOT 1
- IT DOESN'T WORK! HOT 3
- How to support multiple URLs on an API
- additionalProperties:false in generated OpenAPI JSON
- StyleCop incompatibilities
- Include source link information
- Question: Is this Project Active? HOT 1
- This repo is missing important files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi.net.csharpannotations.