Giter Site home page Giter Site logo

kiota-abstractions-php's Introduction

Kiota Abstractions Library for PHP

Build Status Latest Stable Version Coverage

The Kiota abstractions Library for PHP is the PHP library defining the basic constructs Kiota projects need once an SDK has been generated from an OpenAPI definition.

A Kiota generated project will need a reference to the abstraction package to build and run.

Read more about Kiota here.

Using the Abstractions Library

run composer require microsoft/kiota-abstractions or add the following to your composer.json file:

{
    "require": {
        "microsoft/kiota-abstractions": "^1.2.0"
    }
}

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

kiota-abstractions-php's People

Contributors

andreatp avatar andrueastman avatar baywet avatar dependabot[bot] avatar ndiritu avatar silaskenneth avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

andreatp

kiota-abstractions-php's Issues

Add CHANGELOG

  • Add CHANGELOG with previous release context to all Kiota core libs

add shorthand functions for serialization

to facilitate serialization and deserialization of models and collections of models, we're adding static helper functions.
More details to be found at microsoft/kiota#3406

For serialization we need:

  • Serialize(contentType, model): string
  • Serialize(contentType, model): stream
  • SerializeCollection(contentType, models): string
  • SerializeCollection(contentType, models): stream
  • Serialize(model): stream (maps to same one passing the json content type as a constant)
  • Serialize(model): string (same)
  • Serialize(models): stream (same)
  • Serialize(models): string (same)

Note: if converting from stream to string is trivial we can ommit the string overloads
Note: if another parameter for the serialization method needs to be added, feel free to do so
Note: if both a string and and stream method need to be added, but can't have the same name, name the string methods with AsString suffix
Note: if the Json methods and the ones accepting the same content type can't have the same namde/would need to be aliased in the consuming code to avoid conflicts, as a ToJsonSuffix (full convention with string SerializeCollectionToJsonAsString)

For deserialization we need:

  • Deserialize(contentType, stream, createTFromDiscriminatorMethod): T
  • Deserialize(contentType, string, createTFromDiscriminatorMethod): T
  • Deserialize(contentType, stream): T (uses reflection, only if possible, calls into the previous one)
  • Deserialize(contentType, string): T (same)
  • DeserializeCollection(contentType, stream, createCallback): T[]
  • DeserializeCollection(contentType, string, createCallback): T[]
  • reflection version x2
  • Json equivalent with constant for all the previous

Note: the same notes as serialization apply
Note: if the collection and single methods can have the same name, make them same

Fix nested BackedModel and array<BackedModel> properties as values in the Backing Store

Currently, if a model's property is a BackedModel, and the BackedModel has one of its properties updated, only the updated value of the BackedModel will be marked as dirty e.g.

When updating attendee info for an existing event, the newly updated attendee shows up as the only attendee instead of passing the full new list of attendees to the API

$event = $graphServiceClient->me()->events()->byEventId('')->get()->wait();
$updatedAttendee = $event->getAttendees()[0];
$updatedAttendee->setType(new AttendeeType('required'));

$updatedEvent = $graphServiceClient->me()->events()->byEventId('')->put($event)->wait();

// BUG: Only sends the the newly updated attendee object with only the changed 'type' property
// Should send the full initial list of attendees including all the properties of the newly updated attendee

Guid uri template path/query parameter values should be normalized to string

the std uri template library does not handle guids, and wont because it's not a standard API across languages and they don't want to bring on additional dependencies.
We should normalize the value to string (no curlies) before we pass it to the uri template engine.
Originally reported:
std-uritemplate/std-uritemplate#140
microsoft/kiota#4335

Example implementation https://github.com/microsoft/kiota-abstractions-dotnet/blob/5a93d126e9ce30ae332e65f30df7b941e7d7c265/src/RequestInformation.cs#L123

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.