Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mono-repo updates for release #90

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
primaryBranch: main
handleGHRelease: true
manifest: true
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.4.0"
}
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [1.5.0](https://github.com/microsoft/kiota-php/compare/microsoft-kiota-serialization-json-v1.4.0...microsoft-kiota-serialization-json-v1.5.0) (2025-02-10)

### Added

### Changed
### Features

* add kiota bundle ([575e3bc](https://github.com/microsoft/kiota-php/commit/575e3bc147dfcdd02128db5cad46b82959d3e38e))
* add release please configuration to monorepo ([57de3a2](https://github.com/microsoft/kiota-php/commit/57de3a20091d1cd349d3c4b0e840920ac3a57d75))


### Bug Fixes

* Json serialization tests namespace ([e80465e](https://github.com/microsoft/kiota-php/commit/e80465ea81e2fba6c524ce664a2fe18c867219d4))
* removes call to addcslashes in getStringValue() functions ([f7097a1](https://github.com/microsoft/kiota-php/commit/f7097a1e13c71f5fe4246d61dc806ac7300412ea))
* removes call to addcslashes in getStringValue() functions ([64db05d](https://github.com/microsoft/kiota-php/commit/64db05d895bf6e1b09462dbd184665a6e7b3a66f))
* subproject config & CI ([673beef](https://github.com/microsoft/kiota-php/commit/673beef4ae3f99c94a7730bb3810d4a1abdf27d5))

## [1.3.1]

Expand Down
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,20 @@ Read more about Kiota [here](https://github.com/microsoft/kiota/blob/main/README

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

```Shell
```
{
"require": {
"microsoft/kiota-serialization-json": "^1.3.0"
// x-release-please-start-version
"microsoft/kiota-serialization-json": "^1.5.0"
// x-release-end
}
}
```

## 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](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
This project welcomes contributions and suggestions. This project welcomes contributions and suggestions. Issues and pull requests should be made against the [kiota-php](https://github.com/microsoft/kiota-php/) repository.
This repository is only used for releases.

## Trademarks

Expand Down
72 changes: 37 additions & 35 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
{
"name": "microsoft/kiota-serialization-json",
"description": "Implementation of Kiota serialization abstractions using Json.",
"authors": [
{
"name": "Microsoft Graph Client Tooling",
"email": "[email protected]",
"role": "Developer"
"name": "microsoft/kiota-serialization-json",
"description": "Implementation of Kiota serialization abstractions using Json.",
"authors": [
{
"name": "Microsoft Graph Client Tooling",
"email": "[email protected]",
"role": "Developer"
}
],
"license": [
"MIT"
],
"autoload": {
"psr-4": {
"Microsoft\\Kiota\\Serialization\\Json\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Microsoft\\Kiota\\Serialization\\Json\\Tests\\": "tests"
}
},
"require": {
"microsoft/kiota-abstractions": "^1.5.0",
"guzzlehttp/psr7": "^1.6 || ^2",
"php": "^7.4 || ^8.0",
"ext-json": "*"
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"phpunit/phpunit": "^9.6.22",
"phpstan/phpstan": "^1.12.16"
},
"config": {
"allow-plugins": {
"php-http/discovery": false
}
}
],
"license": ["MIT"],
"autoload": {
"psr-4": {
"Microsoft\\Kiota\\Serialization\\Json\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Microsoft\\Kiota\\Serialization\\Tests\\": "tests"
}
},
"require": {
"microsoft/kiota-abstractions": "^1.4.0",
"guzzlehttp/psr7": "^1.6 || ^2",
"php": "^7.4 || ^8",
"ext-json": "*"
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"phpunit/phpunit": "^8 || ^9",
"phpstan/phpstan": "^1.4"
},
"config": {
"allow-plugins": {
"php-http/discovery": false
}
}
}
33 changes: 33 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"bootstrap-sha": "024b6a19a607a946ddfaac0c9a1113855297b324",
"exclude-paths": [
".git",
".idea",
".github",
".vscode",
"tests",
"scripts"
],
"release-as": "1.5.0",
"include-v-in-tag": false,
"include-component-in-tag": false,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"packages": {
".": {
"package-name": "microsoft/kiota-serialization-json",
"changelog-path": "CHANGELOG.md",
"release-type": "simple",
"extra-files": [
"src/Constants.php",
{
"type": "json",
"path": "composer.json",
"jsonpath": "$.require.microsoft/kiota-abstractions"
},
"README.md"
]
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
4 changes: 3 additions & 1 deletion src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

final class Constants
{
public const VERSION = '1.0.1';
// x-release-please-start-version
public const VERSION = '1.5.0';
// x-release-please-end
}
2 changes: 1 addition & 1 deletion src/JsonParseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getChildNode(string $identifier): ?ParseNode {
* @inheritDoc
*/
public function getStringValue(): ?string {
return is_string($this->jsonNode) ? addcslashes($this->jsonNode, "\\\r\n") : null;
return is_string($this->jsonNode) ? $this->jsonNode : null;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/JsonParseNodeFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Microsoft\Kiota\Serialization\Tests;
namespace Microsoft\Kiota\Serialization\Json\Tests;

use GuzzleHttp\Psr7\Utils;
use InvalidArgumentException;
Expand Down
17 changes: 13 additions & 4 deletions tests/JsonParseNodeTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Microsoft\Kiota\Serialization\Tests;
namespace Microsoft\Kiota\Serialization\Json\Tests;

use DateInterval;
use DateTime;
Expand All @@ -13,9 +13,9 @@
use Microsoft\Kiota\Abstractions\Types\Time;
use Microsoft\Kiota\Serialization\Json\JsonParseNode;
use Microsoft\Kiota\Serialization\Json\JsonParseNodeFactory;
use Microsoft\Kiota\Serialization\Tests\Samples\Address;
use Microsoft\Kiota\Serialization\Tests\Samples\MaritalStatus;
use Microsoft\Kiota\Serialization\Tests\Samples\Person;
use Microsoft\Kiota\Serialization\Json\Tests\Samples\Address;
use Microsoft\Kiota\Serialization\Json\Tests\Samples\MaritalStatus;
use Microsoft\Kiota\Serialization\Json\Tests\Samples\Person;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\StreamInterface;

Expand Down Expand Up @@ -160,6 +160,15 @@ public function testGetStringValue(): void{
$this->assertEquals('Silas Kenneth was here', $expected);
}

/**
*/
public function testGetStringValueWithSlashAndWhitespace(): void
{
$this->parseNode = new JsonParseNode('\ This is a test with a tab at then and slash at the beginning \t.');
$expected = $this->parseNode->getStringValue();
$this->assertEquals('\ This is a test with a tab at then and slash at the beginning \t.', $expected);
}

public function testGetChildNode(): void {
$this->stream->rewind();
$this->parseNode = (new JsonParseNodeFactory())->getRootParseNode('application/json', $this->stream);
Expand Down
2 changes: 1 addition & 1 deletion tests/JsonSerializationWriterFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Microsoft\Kiota\Serialization\Tests;
namespace Microsoft\Kiota\Serialization\Json\Tests;

use InvalidArgumentException;
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriterFactory;
Expand Down
8 changes: 4 additions & 4 deletions tests/JsonSerializationWriterTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Microsoft\Kiota\Serialization\Tests;
namespace Microsoft\Kiota\Serialization\Json\Tests;

use DateInterval;
use GuzzleHttp\Psr7\Utils;
Expand All @@ -11,9 +11,9 @@
use Microsoft\Kiota\Abstractions\Types\Date;
use Microsoft\Kiota\Abstractions\Types\Time;
use Microsoft\Kiota\Serialization\Json\JsonSerializationWriter;
use Microsoft\Kiota\Serialization\Tests\Samples\Address;
use Microsoft\Kiota\Serialization\Tests\Samples\MaritalStatus;
use Microsoft\Kiota\Serialization\Tests\Samples\Person;
use Microsoft\Kiota\Serialization\Json\Tests\Samples\Address;
use Microsoft\Kiota\Serialization\Json\Tests\Samples\MaritalStatus;
use Microsoft\Kiota\Serialization\Json\Tests\Samples\Person;
use PHPUnit\Framework\TestCase;

class JsonSerializationWriterTest extends TestCase
Expand Down
4 changes: 2 additions & 2 deletions tests/Samples/Address.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Microsoft\Kiota\Serialization\Tests\Samples;
namespace Microsoft\Kiota\Serialization\Json\Tests\Samples;

use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
Expand Down Expand Up @@ -80,4 +80,4 @@ public function setCity(?string $city): void {
}


}
}
4 changes: 2 additions & 2 deletions tests/Samples/MaritalStatus.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Microsoft\Kiota\Serialization\Tests\Samples;
namespace Microsoft\Kiota\Serialization\Json\Tests\Samples;

use Microsoft\Kiota\Abstractions\Enum;

Expand All @@ -9,4 +9,4 @@ class MaritalStatus extends Enum {
public const COMPLICATED = 'complicated';
public const DIVORCED = 'divorced';
public const MARRIED = 'married';
}
}
2 changes: 1 addition & 1 deletion tests/Samples/Person.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Microsoft\Kiota\Serialization\Tests\Samples;
namespace Microsoft\Kiota\Serialization\Json\Tests\Samples;

use Microsoft\Kiota\Abstractions\Serialization\AdditionalDataHolder;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
Expand Down
Loading