nextcloud / nextcloud/openapi-extractor

Fields with numeric consts default value are incorrectly marked as required

Open
#216 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
11
Forks
4
Avg merge
10h 18m
Merged PRs (30d)
8

Description

Controller

	public function createRoomV2(
		string $name,
		int $type = Room::TYPE_GROUP,
		int $readOnly = Room::READ_WRITE,
		int $listable = Room::LISTABLE_NONE,
		int $messageExpiration = 0,
		int $lobbyState = Webinary::LOBBY_NONE,
		?int $lobbyTimer = null,
		int $sipEnabled = Webinary::SIP_DISABLED,
		int $permissions = Attendee::PERMISSIONS_DEFAULT,
		int $recordingConsent = RecordingService::CONSENT_REQUIRED_NO,
		int $mentionPermissions = Room::MENTION_PERMISSIONS_EVERYONE,
		string $description = '',
		?string $password = null,
		?string $objectType = null,
		?string $objectId = null,
		?string $emoji = null,
		?string $avatarColor = null,
		array $participants = [],
	): DataResponse {

Expectation

Only name is marked as required

Actual

Also fields with consts as default are marked as required

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the extractor interprets the createRoomV2 controller parameters and determines whether each parameter is required. Verify the handling of numeric constant defaults against literal defaults, and consider the work done when only name remains required for the shown signature.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, php
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.