Separating Open API Documentations - swagger

I have quite alot of models and operations in my new backend API that I wish to document.
I am currently making use of the Open API Documentation standard.
Now, it's kindda cubersome keeping all of the Spec files in one giant swagger.yaml file.
My question now is, is it possible for me to separate the documenation files into units so for example
All Operations for Customers go inside customer.yaml
All Operations for Merchants go insider merchants.yaml
And then merging customer.yaml and merchants.yaml into one giant swagger.yaml file that would be exported as the documentation file for the API

Sure, you could use $ref (look up "Remote Reference"). For example, you can break down your giant yaml-file into smaller files. Then you'll end up with a master file, where remote files are included.

Related

Android 11 Storage Access Framework - How to use files?

Hey there fellow devs,
I have come across a problem while migrating our app to the new API 30 standards with the storage access framework (SAF).
I have successfully migrated the file structure and am now using the internal (FilesDir) paths.
Getting images with the MediaStore-Api is also working quite nicely.
But there is one big issue I just can't seem to fix.
In our app, we are using the API "Mapsforge" for Offline-Maps.
This API is using a Java.IO.File-Object we get from a path to a ".map" file which is almost 2GB large.
This file does not come from us, it is a file managed by the customer and put onto the device for us to use, since all the ".Map"-Files are custom.
Since the SAF is returning an Android.Net.Uri, I can't seem to convert it to a Java.IO.File without copying the contents of the file and therefore using even more storage on the device.
Is there any way to use the SAF to get a Java.IO.File-Object I can use in code?
If not, then Android 11 is making it very hard for my Customer to manage his storage.
This API is using a Java.IO.File-Object we get from a path to a ".map" file which is almost 2GB large.
With luck, Mapsforge will offer more flexible APIs in the future. You may wish to contact them about their recommendations.
Is there any way to use the SAF to get a Java.IO.File-Object I can use in code?
No. After all, the user might choose something on Google Drive or another cloud storage provider, rather than a local file. Or, they might choose a file that is inaccessible to your app. Or, they might choose content that is stored in an encrypted file, which needs to be decrypted by the document provider. And so on.

Add or Upload files to Files Tab in Microsoft Teams File Tab

I want to use the Microsoft Graph API to upload files under a Team's File Tab.
Can anyone help here which endpoints and in which sequence I need to use from Microsoft Graph API.
Thanks
You should use the Graph API for this task.
Start with the Microsoft Teams API overview, which has a pretty good introduction and a 4 minute video.
Your next step is the Graph API documentation. It's a big API, so rather than attempting to read it all I suggest you go straight to the portion specific to Teams.
Uploading small files below 4 MB is a bit simpler than uploading larger files.
You can also cheat a little, depending on what you are trying to do. Teams is really based on SharePoint for a lot of the stuff it does. So you can also use the SharePoint API to upload files to the SP site that is operating behind Teams.
There are code examples in the documentation to get you started.
The Files tab in channel is nothing it linked to SharePoint site default folder, Please take a look at Upload Files This API restricted to file size to 4MB. if you want to upload greater than 4MB you need to upload the file in stream or chunks.

Extract text of OneDrive documents using Graph Api

I have been using Ms Graph API, to download the files of OneDrive successfully.
I was looking for a way to read only the text content (for indexing purpose in my application) using Graph API, for different types of files(pdf,xls,zip,Images etc.) instead of going by the conventional approach of downloading the complete file and then extracting the text using some "Text extracting api" and then index the file, which would be a time consuming task. I am aware GraphAPI has its own search features, but it lacks ability to do complicated search like regular expression search (please correct me if I am wrong). I am sure OneDrive does its own indexing for each file which helps a user to do the basic search.
So, is there any way I can get the text content of the documents using the Graph API?
I don't believe getting a 'preview' of text-based documents is currently available through the API. You will need to make a GET request to fetch the content. If you don't want the full document, you can request a partial range of bytes that you believe would be enough for the document. In addition, to make it easier to handle different file types, we currently support converting common file formats to PDF (to possibly standardize your file parsing logic).

Is there a way to download a specific file from the D2L Manage Files area by Valence API or something else?

We're self hosted and have asked for some activity data from our central utility that hosts D2L for us. They're able to produce the data file, but insist on giving us the file through another D2L course putting it in the manage files area. The file is produced on a schedule and follows a standardized name. But in order to get the file someone has to log into D2L, go to the course, find the file in the files area of the course, and download the file from the Manage Files area.
I would like to be able to write a process that would reach into D2L and get the file I'm looking for. I've scanned the Valence API and all that would initially seem to be possible is if these files have a corresponding Topic in the content structure that I could use to get the file to grab.
http://docs.valence.desire2learn.com/res/content.html#get--d2l-api-le-(version)-(orgUnitId)-content-topics-(topicId)
As is they're not inserting a topic pointing to the new file. I'm not seeing anything via Valence that would suggest there's a way to get a file listing of the files area of a course, or even retrieve a specific file.
Is this even possible? Any ideas as to how I could do this?
The Brightspace application APIs have a call that can fetch the underlying file for a content topic of type file.
You can also add a new content topic of type file to the content structure, and set the URL property for the topic to point at the existing file in the content space; this should re-use the file in the course's content space, allowing you to get directly at the file in the content space, assuming you know its name and location in the content space to start with.

ASP.NET: How to retrieve data from access/Excel file?

A company is creating a web site for the organization I work for. Since the web site is still being developed, some modules are not yet there. For instance, in order to print data obtained from a query, one needs first to export it to Excel or Access. Then, from Excel or Access, it is important to do some adjustments (adjust columns width and rows height, modify titles, so on) to make it easy to print.
I would like to create a small web application that will avoid us doing those operations manually. Unfortunately, the other application is in JSP/Java while I only know ASP.NET/C#.
How can I retrieve all this data, which are either in Excel or Access, and reload them into my application for printing?
Thank you
This guy did a brilliant article on getting data from excel using ado.net, I have written a program based on his instructions and it is working fine with Excel 2007 files, and can handle very long column data as well.
Link to article
Have you considered writing a macro in Excel instead of trying to do everything on the server? Creating a macro in VBA isn't difficult, and you can distribute it as an Add-In to your users. Takes some good instructions for them to install it, but avoids all the potentially messy issues of import/export of Excel files.

Resources