fsprojects / openapitypeprovider Goto Github PK
View Code? Open in Web Editor NEWF# type provider for Open API specification
F# type provider for Open API specification
I'm a bit confused why I'm getting this TypeProvider error. I've got the latest Visual Studio 15.8.7 installed.
Severity Code Description Project File Line Suppression State
Error FS3031 The type provider 'C:\Users\taggac.nuget\packages\openapitypeprovider\1.5.1\lib\netstandard2.0\OpenAPITypeProvider.dll' reported an error: Assembly attribute 'TypeProviderAssemblyAttribute' refers to a designer assembly 'C:\Users\taggac.nuget\packages\openapitypeprovider\1.5.1\lib\netstandard2.0\OpenAPITypeProvider.dll' which cannot be loaded or doesn't exist. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. RegisterDeadboltClients C:\Users\taggac\coreservices\RegisterDeadboltClients\FSC 1 Active
This is probably for @dsyme & other fsprojects owner. I tried to setup automated build of this TP on Azure DevOps, but got error:
Unable to configure a service on the selected GitHub repository. This is likely caused by not having the necessary permission to manage hooks for the selected repository.
Do I need higher permissions for this repo? Or should I set different CI for this type provider?
Thanks for any hint.
For yaml like this:
ObjectA:
type: object
properties:
subObj:
$ref: '#/components/schemas/ObjectB'
ObjectB:
type: object
properties:
name:
type: string
schemas contains ObjectB
and SubObj
instead of ObjectA
. Since ObjectA
is known name of schema, it should be preffered.
Hi! Is this library work with fable?
Hello,
I just tested this wonderful typeProvider and I'm able to create my JSON very nicely.
But I'm a bit confused what to do now.
Does this TP also expose functions to call the actual API? Or do I need to do that part myself?
If so, any samples or best practices on that?
Many thanks,
Florian
Hi,
Thanks for this great library. Maybe I'm missing something (haven't really used OpenAPI much), but an array with nullable items does not seem to come through with items wrapped in Option
. For example:
"Example": {
"title": "Example",
"required": [ "items" ],
"type": "object",
"properties": {
"items": {
"title": "Items",
"type": "array",
"items": {
"type": "integer",
"nullable": true
},
"description": "Should be Option<int>, but is just int"
},
}
},
With this definition, Items
is a List<int>
rather than a List<Option<int>>
. Is this a bug, or am I doing something wrong?
The format of the path url template is perfect for registering routes in ASP.NET Core. Consider adding a Template
or AsString
member/property to provide the path as a string for this use case.
Having enum like this on root level:
RiskSeverity:
type: string
enum:
- NEGLIGIBLE
- MINOR
- MODERATE
- MAJOR
- SEVERE
creates type RiskSeverity
with all cases having the same name RiskSeverity
Accessing parsed value in parsed.InvoiceAddress.Value.City
from JSON
{"name":"Roman","invoiceAddress":{"city":"Prague","country":"CZE","street":"Krakovska 9b","zip":"15100"}}
throws
Unable to cast object of type 'Microsoft.FSharp.Core.FSharpOption`1[System.Object]' to type 'Microsoft.FSharp.Core.FSharpOption`1[OpenAPITypeProvider.ObjectValue]'.
I'm considering using this TP, but I need to know a little bit more about how it handles oneOf
/anyOf
.
The readme states that oneOf
and anyOf
(well, it says manyOf
, but that's an error, it should be anyOf
) are not supported. But what happens when the TP encounters these in an OpenAPI document? Can it parse the document at all?
If the TP gives an error when encountering these, then that's a show-stopper for using this TP, because any API provider may add oneOf
/anyOf
at any time, rendering this TP suddenly useless for that API and requiring a massive rewrite of client code.
A workaround could be that oneOf
and anyOf
can be treated as allOf
, except that everything is optional. Then at least you have the possibility to use the TP for documents that have oneOf
/anyOf
; you'd just have to make sure that you use a valid combination of properties.
Use _Item
for single type instead of _Items
I'd love to see support for operationId
s. I would think they would be static methods on the type.
https://swagger.io/docs/specification/paths-and-operations/
Hi @Dzoukr!
Amazing work :)
Just to say there is an open invitation to move this to http://github.com/fsprojects should you wish. The main advantage is that there is a backup maintainer (can help make the project live a long time), and it can help attracting attention and raising visibility
Cheers!
Don
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.