nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: striglia/pyramid_swagger
Pull request #217 (2017-09-13 12:16:12)

Adding support of new Bravado param `include_missing_properties`
In some cases we need to use [JSON Merge Patch Format](https://tools.ietf.org/html/rfc7386) for PATCH resource. If we need to update only person's last name we send `{'last_name': 'Name'}` ignoring other fields but current logic set `None` to all fields that weren't included into request. 
Bravado added special parameter `include_missing_properties` to handle such cases so it would be great to add support of this config property into Your library.

Default value is `True` so I updated test to handle `False` case.


Patch:
diff --git a/docs/configuration.rst b/docs/configuration.rst
index bc1a2bd..c6357ea 100644
--- a/docs/configuration.rst
+++ b/docs/configuration.rst
@@ -55,6 +55,11 @@ A few relevant settings for your `Pyramid .ini file <http://docs.pylonsproject.o
         # Default: False
         pyramid_swagger.use_models = false
 
+        # Set value for property defined in swagger schema to None if value was not provided.
+        # Skip property if value is missed and include_missing_properties is False.
+        # Default: True
+        pyramid_swagger.include_missing_properties = true
+
         # Exclude certain endpoints from validation. Takes a list of regular
         # expressions.
         # Default: ^/static/? ^/api-docs/? ^/swagger.json
diff --git a/pyramid_swagger/ingest.py b/pyramid_swagger/ingest.py
index dbc26e0..cfe3b7d 100644
--- a/pyramid_swagger/ingest.py
+++ b/pyramid_swagger/ingest.py
@@ -204,6 +204,7 @@ def create_bravado_core_config(settings):
             'validate_swagger_spec',
         'pyramid_swagger.use_models': 'use_models',
         'pyramid_swagger.user_formats': 'formats',
+        'pyramid_swagger.include_missing_properties': 'include_missing_properties',
     }
 
     bravado_core_config_defaults = {


Test patch:
diff --git a/tests/ingest_test.py b/tests/ingest_test.py
index 1140851..b577460 100644
--- a/tests/ingest_test.py
+++ b/tests/ingest_test.py
@@ -127,13 +127,15 @@ def test_create_bravado_core_config_non_empty():
         'pyramid_swagger.enable_swagger_spec_validation': True,
         'pyramid_swagger.use_models': True,
         'pyramid_swagger.user_formats': [some_format],
+        'pyramid_swagger.include_missing_properties': False,
     }
     expected_bravado_core_config = {
         'validate_requests': True,
         'validate_responses': False,
         'validate_swagger_spec': True,
         'use_models': True,
-        'formats': [some_format]
+        'formats': [some_format],
+        'include_missing_properties': False
     }
     bravado_core_config = create_bravado_core_config(pyramid_swagger_config)
     assert expected_bravado_core_config == bravado_core_config
Repository: google/go-github
Pull request #1209 (2019-06-24 14:21:25)

Add missing RepositoryComment.NodeID field.


Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 0bb206bd..687c9689 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -9940,6 +9940,14 @@ func (r *RepositoryComment) GetID() int64 {
 	return *r.ID
 }
 
+// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.
+func (r *RepositoryComment) GetNodeID() string {
+	if r == nil || r.NodeID == nil {
+		return ""
+	}
+	return *r.NodeID
+}
+
 // GetPath returns the Path field if it's non-nil, zero value otherwise.
 func (r *RepositoryComment) GetPath() string {
 	if r == nil || r.Path == nil {
diff --git a/github/repos_comments.go b/github/repos_comments.go
index fa2377d4..380ca3d3 100644
--- a/github/repos_comments.go
+++ b/github/repos_comments.go
@@ -16,6 +16,7 @@ type RepositoryComment struct {
 	HTMLURL   *string    `json:"html_url,omitempty"`
 	URL       *string    `json:"url,omitempty"`
 	ID        *int64     `json:"id,omitempty"`
+	NodeID    *string    `json:"node_id,omitempty"`
 	CommitID  *string    `json:"commit_id,omitempty"`
 	User      *User      `json:"user,omitempty"`
 	Reactions *Reactions `json:"reactions,omitempty"`


Test patch:
diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go
index 2271a9d2..e8c0e268 100644
--- a/github/github-stringify_test.go
+++ b/github/github-stringify_test.go
@@ -1262,6 +1262,7 @@ func TestRepositoryComment_String(t *testing.T) {
 		HTMLURL:   String(""),
 		URL:       String(""),
 		ID:        Int64(0),
+		NodeID:    String(""),
 		CommitID:  String(""),
 		User:      &User{},
 		Reactions: &Reactions{},
@@ -1269,7 +1270,7 @@ func TestRepositoryComment_String(t *testing.T) {
 		Path:      String(""),
 		Position:  Int(0),
 	}
-	want := `github.RepositoryComment{HTMLURL:"", URL:"", ID:0, CommitID:"", User:github.User{}, Reactions:github.Reactions{}, Body:"", Path:"", Position:0}`
+	want := `github.RepositoryComment{HTMLURL:"", URL:"", ID:0, NodeID:"", CommitID:"", User:github.User{}, Reactions:github.Reactions{}, Body:"", Path:"", Position:0}`
 	if got := v.String(); got != want {
 		t.Errorf("RepositoryComment.String = %v, want %v", got, want)
 	}