rusticisoftware / scormcloud-api-v2-client-php Goto Github PK
View Code? Open in Web Editor NEWSwagger Generated PHP Client for SCORM Cloud API v2
License: Apache License 2.0
Swagger Generated PHP Client for SCORM Cloud API v2
License: Apache License 2.0
Method CourseApi::createUploadAndImportCourseJobWithHttpInfo() accepts bool param $may_create_new_version but ApiClient::callApi() method converts 'true' bool value to int '1'. API method only accepts boolean values. It does not recognizes mayCreateNewVersion passed as int.
Here is an example of the request:
[DEBUG] HTTP Request body BEGIN
Array
(
[file] => CURLFile Object
(
[name] => /tmp/phpxNLAFV
[mime] =>
[postname] =>
)
)
END
POST /api/v2//courses/importJobs/upload?courseId=any_course_id&mayCreateNewVersion=1 HTTP/2
Host: cloud.scorm.com
user-agent: Swagger-Codegen/1.0.0/php
accept: application/json
authorization: Basic basic_token_auth
content-length: 411332
content-type: multipart/form-data; boundary=------------------------6fcc904db869c4fd
Hello,
I created a totally new project to test this and my composer.json looks like this:
{
"name": "hese/composer-test",
"authors": [
{
"name": "Hesesses",
}
],
"repositories": [
{
"type": "git",
"url": "https://github.com/RusticiSoftware/scormcloud-api-v2-client-php.git"
}
],
"require": {
"RusticiSoftware/scormcloud-api-v2-client-php": "*@dev"
}
}
and running composer install
gives:
composer install
Deprecation warning: require.RusticiSoftware/scormcloud-api-v2-client-php is invalid, it should not contain uppercase characters. Please use rusticisoftware/scormcloud-api-v2-client-php instead. Make sure you fix this as Composer 2.0 will error.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package rusticisoftware/scormcloud-api-v2-client-php could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
I had this working week ago, but I tried to update the package. Update didnt work and I tried to delete the whole package and install it again, but it wont install.
Any ideas?
The SCORM Cloud API seems to not accept integer values where it expects a true/false value.
Take the /courses endpoint for example. Requesting a list of all courses using the getCourses method, there are 2 parameters include_registration_count
and include_course_metadata
that have the parameter values set as boolean.
If I call the method
/**
* 7th parameter is include registration count
*/
$course->getCourses( null, null, null, null, null, null, true, false );
I expect the registration count to be present in the response, however it is not. This is because when the query URL is built, it is using the PHP http_build_query
function which converts boolean values to integer, thus making the request:
https://cloud.scorm.com/api/v2/courses?includeRegistrationCount=1
This will not return the registration count in the response.
Instead you must use the value true
as a string:
$course->getCourses( null, null, null, null, null, null, 'true', false );
Which will then generate the request URL:
https://cloud.scorm.com/api/v2/courses?includeRegistrationCount=true
This has not been tested on other methods but one could assume this to be true across the board. This could be fixed by converting the boolean values to string before passing into http_build_query
, however like I said this has not been tested on any other methods so I am not aware of any implications.
I have used the sample code as it is with my app_id and secret and I get this error in the browser:
[401] Client error: POST https://cloud.scorm.com/api/v2//appManagement/token
resulted in a 401 401
response: {"error":"Authorization Required."}
Using the same details in the web site the authorization works and the curl commands connect correctly too with those details encoded:
https://cloud.scorm.com/docs/v2/reference/swagger/
Am I missing anything?
It should not contain uppercase characters. Please use rusticisoftware/scormcloud-api-v2-client-php instead. Make sure you fix this as Composer 2.0 will error.
All the classes within directories seem to have their namespaces doubled.
the src/Api/ApplicationManagementApi.php class for example has it's namespace set to:
namespace RusticiSoftware\Cloud\V2\RusticiSoftware\Cloud\V2\Api;
If I change it to just namespace RusticiSoftware\Cloud\V2\Api;
Then it loads properly when attempting to "use" it.
This is consistent in all files within the Api directory and the Model directory.
Hello
The unorthodox locking to *@dev
requires composer.json minimum-stability
to be downgraded from stable
to dev
. This has me very weary in a project that has dozens upon dozens of stable dependencies.
It also raises concerns that there is a lack of semantic versioning - though Swagger Codegen likely respects that.
Thoughts? Would you consider it ok to have to downgrade stability in order to use this package?
Thanks!
The library cannot be pulled while using PHP 8.
Hello,
Just FYI. In the current version I'm getting error as below
"Type error: DateTime::__construct() expects parameter 1 to be string, object given" at /var/www/html/vendor/rustici-software/scormcloud-api-v2-client-php/src/ObjectSerializer.php line 250
Reason behind this is different payload in the request according to CourseSchema
Payload fragment from import job request sent on postback url
"created": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
"year": 2020,
"month": "JANUARY",
"monthValue": 1,
"dayOfMonth": 29,
"hour": 8,
"minute": 50,
"second": 26,
"nano": 0,
"dayOfWeek": "WEDNESDAY",
"dayOfYear": 29
},
"updated": {
"offset": {
"totalSeconds": 0,
"id": "Z",
"rules": {
"fixedOffset": true,
"transitions": [],
"transitionRules": []
}
},
\RusticiSoftware\Cloud\V2\ObjectSerializer::deserialize
passes date objects from above value to \DateTime()
but it should be string.
Hello,
I cannot install and provide your solution to my customers because the library has required guzzle 6, as you know guzzle 7 has been release the past year : https://laravel-news.com/guzzle-7-released.
I think the PHP library should be updated in order to work in future PHP releases 7.x and 8.x because 5.x is not supported anymore.
Problem 1
- rustici-software/scormcloud-api-v2-client-php[1.1.0, ..., 1.1.1] require guzzlehttp/guzzle ~6.0 -> satisfiable by guzzlehttp/guzzle[6.0.0, ..., 6.5.5].
- You can only install one version of a package, so only one of these can be installed: guzzlehttp/guzzle[6.0.0, ..., 6.5.5, 7.0.0, ..., 7.3.0].
Could you tell me if you have plans to upgrade you library ?
Best regards,
Isaac Flores
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.