microsoftgraph / microsoftgraph/msgraph-sdk-java

Create Page in OneNote using Java SDK v6.x

オープン
#2,083 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area:serialization type:bug
主要言語
Java
スター
444
フォーク
154
平均マージ
18時間 28分
マージ済み PR(30日)
4

説明

My current app successfully creates pages in OneNote using the Java SDK 5.x. I am looking to update to the latest Java SDK 6.x (in the process of also adding support for OneDrive).

I have read through the Microsoft Graph Java SDK v6 Changelog and Upgrade Guide and am obtaining valid tokens. I can't find, however, any documentation or examples of how to create a page in OneNote using the Java SDK 6.x. The article Create onenotePage provides examples for HTTP, CLI, and JavaScript, but is missing the examples for C#, Go, Java, etc. provided for other actions such as Create notebook.

Is it possible to create pages using the Java SDK 6.x? Are there any examples?

I have tried the Kotlin code below in the absence of documentation, but always receive the error "The multi-part payload was malformed". Debugging by enabling okhttp logging leads me to believe that this approach results in posting a serialized version of the OnenotePage object rather than the contents field as required. (I didn't provide my initialization for 'contents' as the whole approach seems invalid.)

val mypage = OnenotePage()
mypage.content = content

mGraphClient!!.me().onenote()
    .pages()
    .withUrl("https://graph.microsoft.com/v1.0/me/onenote/pages?sectionName=MySection")
    .post(mypage) { requestConfiguration ->
        requestConfiguration.headers.add(
            "content-type",
            "multipart/form-data; boundary=MyBoundary1234"
        )
    }

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Microsoft Graph Java SDK v6 Upgrade Guide と、issue にリンクされている OneNote create-page の記事から始め、利用可能な Java SDK のリクエストパターンを既存の HTTP および JavaScript の例と比較します。サポートされている multipart リクエストの形式を確認し、想定されるリクエスト内容と明確な完了確認を含む、動作する Java 6.x の例を記載します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api, documentation
issue の種類
ドキュメント
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。